Browsed by
Tag: lofting

Parameterized Mobius Strip

Parameterized Mobius Strip

Compatible with WizoScript versions: 1.70

Demonstrates generation of a mobius strip based on a set of parameters. Uses 2D sketch copying and rotation followed by a loft. Requires Geomagic Design 16.0.1.16490 or later.

# creates a mobius strip with a configurable number of rotations
 
Mobius = Part("Mobius")
 
# dimensions of mobius strip
Diameter = 100.0
Width = 20.0
Height = 5.0
# number of 360 degree twists in mobius strip
Rotations = 2
# more steps = better accuracy
Steps = 30
 
# calculate how far we rotate through 360 degrees for each step
RotationPerStep = Rotations / float(Steps) * 360.0
DegreesPerStep = 360.0 / Steps
 
# create the base sketch we will use as a template for all other sketches
S0Plane = Mobius.GetPlane("XY-Plane")
S0 = Mobius.AddSketch("S0", S0Plane)
S0.AddRectangle(Diameter, -Height / 2, Diameter + Width, Height / 2, False)
Sketches = [S0]
 
# generate sketches
for Step in range (1, Steps):
  Plane = Mobius.AddPlane("S" + str(Step), S0Plane, Mobius.GetAxis("Y-Axis"), DegreesPerStep * Step)
  Sketch = Mobius.AddSketch("S" + str(Step), Plane)
  Sketch.CopyFrom(S0, RotationPerStep * Step, Diameter + (Width / 2), 0, 0, 0, 0, 0, 100.0)
  Sketches.append(Sketch)
 
# create loft, connecting ends
Mobius.AddLoftBoss("Strip", Sketches, True, True, False, True)
Lofting with Guide Curve

Lofting with Guide Curve

Compatible with WizoScript versions: 1.70

An example of creating a loft with a guide curve. This can easily be extended to use multiple curves. Requires Geomagic Design 16.0.1.16490 or later.

# create part
P = Part("foo")
 
# create sketch for bottom of loft
Bottom = P.AddSketch("Bottom", P.GetPlane("XY-Plane"))
Bottom.AddRectangle(0, 0, 10, 10, False)
 
# create sketch for top of loft
TopPlane = P.AddPlane("Top Plane", P.GetPlane("XY-Plane"), 30)
Top = P.AddSketch("Top", TopPlane)
Top.AddRectangle(0, 0, 50, 50, False)
 
# create guide curve
Guide = P.Add3DSketch("Guide")
Guide.AddBspline([10,10,0, 20,20,5, 45,45,15, 50,50,30])
 
# create loft using guide curve
P.AddLoftBoss("Loft Test", [Bottom, Top], [Guide], GuideCurveTypes.Global, True, False, False, False)