Page 1 of 1

Sweep with a twist

Posted: Wed Aug 21, 2024 2:46 am
by Tom Barnaby
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.

Re: Sweep with a twist

Posted: Thu Aug 22, 2024 5:48 am
by Prashant Kande
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

Code: Select all

IBRepWire_DG BuildWire(double z){}
You just need to add another parameter like

Code: Select all

IBRepWire_DG BuildWire(double z, double twistAngle){}
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.