Sweep along 3D poly

Sweep along 3D poly

scott_bolton
Advocate Advocate
1,042 Views
4 Replies
Message 1 of 5

Sweep along 3D poly

scott_bolton
Advocate
Advocate

(Previously posted on AutoCAD forum - I really need code to query the lines.)

Hi,

I'm encountering anomalies with the sweep command. See the attached files.

I have two 3D polylines, one cyan and one red. If I sweep the same closed polyline along each line the cyan path results in an upside-down solid. If I truncate the cyan line the result is correctly orientated. There's obviously some dodgy geometry in the cyan line so my question is, how can I query the line and correct it prior to sweeping?

A solution on the AutoCAD forum involved creating various forms of the profile and then selecting the one that gives the desired result but this is a purely manual solution. I'm really looking to investigate the geometry of the 3D polyline. The two lines in the attached drawing both appear to be the same - on the same UCS and travelling in the same direction but something's causing problems. In my lisp I now rip the simple XYZ coordinates of the  3D polyline and create a brand new one at WCS but I still get the problem. I've tried OVERKILL and there's nothing untoward.

S

0 Likes
1,043 Views
4 Replies
Replies (4)
Message 2 of 5

yangguoshe
Advocate
Advocate

GIF.gif

0 Likes
Message 3 of 5

CodeDing
Advisor
Advisor

@scott_bolton ,

 

What @yangguoshe  fails to mention in their demonstration is the end in which the lines are selected...

(I have tested this to confirm also)

When using SWEEP if the red line is selected at the end NEAREST to your object then all sweeps as expected..

When using SWEEP if the blue line is selected at the end FARTHEST to your object then all sweeps as expected..

 

I am not sure why this happens.. I tried REVERSING the blue line to fix but that did not help.

 

Best,

~DD

0 Likes
Message 4 of 5

john.uhden
Mentor
Mentor

Maybe if the road alignment were smoother, there would be no need for the Jersey barrier.

Then again, I love to see the results of construction when the engineer and the contractor get it right.

John F. Uhden

0 Likes
Message 5 of 5

scott_bolton
Advocate
Advocate

Chaps,

I haven't been able to find a direct solution to this in order to determine which way the object will sweep but have been able to code a fix. All edges of my object should be above the path so I determine the minimum Z value of the path and the object using vla-GetBoundingBox. A comparison between the two enables me to determine if the object should be rotated before sweeping. This solution would not work if the path were to be within the shape, for example the centreline of a duct, but for now I'm happy.

S

0 Likes