Hello forum.
I need to extrude a profile like a simple rectangle in x and y plane, along a path (e.g. from (0,0,0) to (0,0,50)). The problem is that I also need to rotate the profile while sweeping with a predefined angle. I could not find an example for that.
Thanks for your advice.
Sweep with a twist
-
- Posts: 65
- Joined: Tue Jun 18, 2024 6:12 am
Re: Sweep with a twist
Hello Tom
Surfaces sample demonstrates building an extrusion of a (x,y) curve in z direction.
First, you need a procedure which builds a flat polygonal wire with straight edges at a z = z0 plane. FaceForm.BuildFace() (with a simple modification) shows building a wire like that. Let us suppose it looks like
You just need to add another parameter like
and inside on start rotate the points you are using by the twistAngle.
With the wires for each z level constructed, you can build the extruded surfaces similar to SurfacesForm.CreateSurface() from the Surfaces sample.
Surfaces sample demonstrates building an extrusion of a (x,y) curve in z direction.
First, you need a procedure which builds a flat polygonal wire with straight edges at a z = z0 plane. FaceForm.BuildFace() (with a simple modification) shows building a wire like that. Let us suppose it looks like
Code: Select all
IBRepWire_DG BuildWire(double z){}
Code: Select all
IBRepWire_DG BuildWire(double z, double twistAngle){}
With the wires for each z level constructed, you can build the extruded surfaces similar to SurfacesForm.CreateSurface() from the Surfaces sample.