Sweep with a twist

Everything DG Kernel: Technical discussions and issues
Post Reply
Tom Barnaby
Posts: 1
Joined: Wed Aug 21, 2024 2:40 am

Sweep with a twist

Post 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.
Prashant Kande
Posts: 65
Joined: Tue Jun 18, 2024 6:12 am

Re: Sweep with a twist

Post 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.
Post Reply