# goblet.scl -- Alpha_1 Tutorial Example. # Use of a general sweep with a profile curve is demonstrated by making # a simple goblet as a variable scaling of a square cross-section that # is swept along a linear axis curve and blended into a circular # cross-section. # Control points for a goblet shaped profile curve. << GobPt1 : pt( 0.0, 0.24 ); GobPt2 : pt( 0.05, 0.24 ); GobPt3 : pt( 0.1, 0.24 ); GobPt4 : pt( 0.15, 0.04 ); GobPt5 : pt( 0.2, 0.04 ); GobPt6 : pt( 0.25, 0.04 ); GobPt7 : pt( 0.30, 0.16 ); GobPt8 : pt( 0.35, 0.16 ); GobPt9 : pt( 0.39, 0.04 ); GobPt10 : pt( 0.6, 0.04 ); GobPt11 : pt( 0.6, 0.32 ); GobPt12 : pt( 1.0, 0.24 ); >> show( GobPt1, GobPt2, GobPt3, GobPt4, GobPt5, GobPt6, GobPt7, GobPt8, GobPt9, GobPt10, GobPt11, GobPt12 ); # Note that the profile curve represents a function of X. GobletProfile : uniOpCrv( cubic, array( GobPt1, GobPt2, GobPt3, GobPt4, GobPt5, GobPt6, GobPt7, GobPt8, GobPt9, GobPt10, GobPt11, GobPt12 )); show( GobletProfile ); # Use a linear axis curve. We degree raise the axis to a cubic # to get a resulting sweep surface that is smooth. GobletAxis : raiseCrvOrder( profile( pt( 0, 0 ), pt( 1, 0 )), cubic ); # We'll start with a square cross section. UnitSqrSec : profile( pt(1,1), pt(-1,1), pt(-1,-1), pt(1,-1), pt(1,1) ); # We'll blend from a square to a circular cross section. # We need to rotate the square cross section so as to align it with # the starting point of the circular cross section. RotUnitSqrSec : objTransform( UnitSqrSec, rz( -45 ) ); # The specification below indicates that as we sweep along # the axis curve: from arc length value( 0.0 ) to( 0.1 ) the square cross # section should be used. From( 0.1 ) to( 0.15 ) a blend of the square and # circle cross sections should be used. From( 0.15 ) to the end of # the curve the circular cross section should be used. SectionCrvs : array( RotUnitSqrSec, UnitCircle ); SectionParams : array( 0.1, 0.15 ); Goblet : generalSweep( GobletAxis, SectionCrvs, SectionParams, "arc_length_blend", GobletProfile, false ); dumpA1File( array( Goblet ), "/tmp/goblet.a1" );