Sweeping works with two of the profiles but not with all three profiles


I am trying to make a sweep using three profiles, but the result is faulty. However, it works when using one or two of the profiles (any combination).

All the profiles seem to be correctly positioned within the shape, is there a problem with the profiles, or with the sweeping algo?

I am using Open CASCADE 7.7.0.

Draw code:

pload ALL

restore "spine.brep" s
restore "profile1.brep" p1
restore "profile2.brep" p2
restore "profile3.brep" p3

mksweep s
setsweep -DT
addsweep p1
addsweep p2
addsweep p3
buildsweep r -C -S

checkshape r

vinit -exitOnClose
vdisplay -dispMode 1 s p1 p2 p3 r
Thomas Anderson's picture

1) Your spine is made entirely of lines. The 'arc' is a fine polygon with C0 conditions. I am guessing you want an actual arc there and so does opencascade.

2) Why are you using a discrete trihedron instead of corrected frenet, the default? GeomFill_DiscreteTrihedron says "The requirement for path curve is only G1"

3) Your profiles have the same radius and appear normal to and centered on the path. Why do you need more than 1 profile?

jerome caucat's picture

Thank you Thomas,

1) The input data comes from a file that I do not control. The spine can be a NURBS or a polyline, I can apply fixes and conversions, but the code has to stay generic for all cases. In case of failure, like here, I have a fallback code that removes small edges and converts the spine to C1, but in this case the result is all distorted.
2) I use a discrete trihedron because this is what gave the best results in most cases. Although, my code was implemented a while ago, and a lot of fixes have been done in OpenCascade since, I could retry using corrected frenet. But, using corrected frenet does not help with my current problem.
3) I do not control the number of profiles that are provided, I am not sure if I can make rules to confidently determine which profiles I can discard.

What I find surprising is that it works with any couple of two profiles, just not the three together. And this leads me to believe that the problem does not come from the spine itself.