Twisting During Sweep Along Closed Curve

Hello!

When performing a sweep along a relatively complex closed curve, the result includes some unwanted helical twisting (see image below, hopefully it is clear enough). For clarity, the surface being swept is a rectangle.

When performing a sweep of the same surface over just a portion of the curve, the result does not include the same helical twisting. The images below include both the partial sweep and the full and partial sweeps together.


It is worth noting that aside from the beginning of the sweep, the orientation of the cross-section along the sweep is rather different. Any help explaining what is happening, as well as any solution to avoid the twisting, would be greatly appreciated! I am happy to provide whatever additional information is needed.

Thanks!

Connor

Hi @camoreno. Welcome to the forum.

My answer here is more speculation than definitive. As you sweep along any curve, the cross-section orientation is defined by the Frenet frame at any point along the spline curve. The Frenet frame is defined by the tangent, the normal, and the binormal (cross(T, N)) at every point along the spline.

My guess is that when you break the curve, you actually have a slightly different underlying spline representation. The periodic spline contains locations where the Frenet frame spirals about the curve causing the helical sections that you see.

Can you do something like the following:

  1. Break up the curve.
  2. Sweep along smaller sections and use the terminating rectangle as the start of a new section.
  3. Imprint and merge the sections after the sweep.
    a) Alternatively, you can click off the “Individual Volumes” option to create a single volume.
    b) or you can do a Boolean Unite to create a single volume.

Testing on my end with just some random points for a fitted spline and then using a tangent curve to create first derivative continuity between the end points gives pretty good results. That does lend credence to my speculation.

reset
create vertex 0 0 0
create vertex 1 0 0
create vertex 2 1 -1
create vertex 2 2 1
create vertex -1 1 0
create curve spline location vertex 1 2 3 4 5 1 
create surface rectangle width .1 xplane 
sweep surface 1  along curve 1   individual 
volume 1 scheme Sweep source surface 3 target surface 5 
mesh surf all
mesh vol 1

image

Karl

Hi @karl, thank you for the quick response!

Your speculation makes good sense to me! I imagined a similar workflow with breaking up the sweep into sections, but my concern is matching the terminating surface of the final section to the starting surface of the initial section to close the loop. Perhaps this is what you mean by using a tangent curve to create continuity between the end points (unless that refers to the guide curve)?

Connor

Hi @camoreno,

I got the ends to match by doing a create curve <ids> combine. This will create a new curve from the existing ones. The caveat on this is that the curves must be first derivative continuous (C1). That gave me a continuous curve that I could sweep along and the start and end surfaces matched correctly.

Karl

@karl,

Are you suggesting to create two separate path segments, combine them, then sweep over that closed path?

When doing so, I get the following error when combining the segments: ERROR: Error combining Curves. Unfortunately, this is not very descriptive but pictured below are the two segments (hopefully the image is clear).

Perhaps this has to do with the segments (not) being first derivative continuous? I’m a bit confused about this condition. I assume this has to do with the tangent rather than the normal or binormal in the Frenet frame but perhaps it is all three. If this is the issue, is there a way to enforce C1 between the segments?

I’d also like to point out that the error above results from the command create curve combine curve <ids>, which is what Cubit executes when using the GUI and is slightly different from the suggested create curve <ids> combine. When using the latter, no error results but the segments are not combined either (see image below).


Screen Shot 2023-02-10 at 10.59.36 AM

It is small, but you can see that a third segment is made at the start of the curve. It is worth noting that the two original segments do touch.

Hopefully that’s not more information than needed and this is all actually helpful towards resolving the issue.

I appreciate your help!

Connor

The error is probably related to my comment that the curves have to be C1 continuous. Maybe try the curve tangent option to fill the gap. All you need to provide is the start and end vertices of an existing curve and it will use the existing tangents at the endpoints.

@karl,

Doing so resulted in much the same sweep as before (see below). Not sure if combining the curves overwrites the original Frenet frames along the curve.

Connor

Let’s try this do something like:

create vertex on curve 1  segment 100

Use however many segments you need to capture the original curve, then do something like

create spline vertex 1 2 to 100 1

where the 1 should be the existing vertex on the curve. If ids are off, you can issue a compress command to restart all numbering at 1. There should be at least one vertex on the original curve. This will create a new spline that only approximates the original but will pass through every given point on the original curve. It will start and end at vertex 1

You can do

label vertex on

or

locate vertex in curve all

to see the existing vertices in the curve. label vertex off turns off the labeling.

Karl

@karl,

I’m a bit confused about why we would want to recreate the curve. This seems essentially like the original workflow I use in Cubit to create the guide curve. I use Cubit to generate vertices from point locus data and generate a spline across those vertices. If you could elaborate, I’d appreciate it.

Thanks!

Connor

Hi Connor,

I thought you were maybe getting the curve from someplace else. I didn’t know you were already building this in Cubit.

I will have to give this some more thought. Can you send me the script that you are using to build the curve?

Thanks,
Karl