Jump to content

Sweep Object in 3D Lines and Curves without Twist


Recommended Posts

Posted

Greendamo posted a thread titled "Sweep Parallel" in 3D Modelling Forum.

 

As a follow-up to this thread, I wish to post my autolisp for review in this section, which in my opinion could be useful.

 

This autolisp will create solids/surfaces in 3D or 2D line and curves. However, there are some limitations and also conditions to satisfy.

 

Please refer to header in the autolisp for more information.

 

The autolisp produce this:

 

SECT3D Curves and Lines.jpg

 

 

SECT3D Autolisp

 

SECT3D.lsp

Posted

Hi CW Hew

Interesting work. I tested your code and it works quite well for complex zig-zag 3D lines.

 

I ran into some type of error when used on the first four segments of the attached file. The routine halts at the point shown. See the command sequence below.

 

To speculate:

Given that the lines are all orthogonal, the issue may be related AutoCAD's Arbitrary Axis flip.

 


Command:
Create Objects in 3D or 2D lines and Arcs-Draft Version. Type: 
SECT3D to run.
Copyright(c) Hew Choon Ming at [email="minhew@brunet.bn"]minhew@brunet.bn[/email], 
February 2012
Command:
Command: SECT3d


Select Objects for the Sweep:
Select object:
Select Base Point 
for Section: mid
of
Pick start Point:
Pick the location of next 
vertex:
Radius of bend at vertex or (Hit ENTER to create): 6


Pick the location of next vertex:
Radius of bend at vertex or (Hit 
ENTER to create): 6


Pick the location of next vertex:
Radius of bend at vertex or (Hit 
ENTER to create): 6


Pick the location of next vertex:
Radius of bend at vertex or (Hit 
ENTER to create):


Current positive angle:  ANGDIR=counterclockwise  ANGBASE=0


Current positive angle:  ANGDIR=counterclockwise  ANGBASE=0

Orthogonal.dwg

Posted

Hi Seant,

 

Thanks for trying out the lisp.

 

The problem lies on problem in the creation of solids/surfaces for vertical members as mentioned in the lisp header.

 

Explanation

Vertical members are OMNI-Directional and hence, the limitation

 

Calculations in the lisp are based on having the section perpendicular to the alignment and having the top part of the section facing UP.

 

Hence, you will not be able to create as you have wanted.

 

I have a lisp which I called PIPE3D to create rod or tube pipework which can through any type of alignment.

 

Circles being symmetrical do not have the above constraints. I will tidy it up and post it shortly in this thread.

Posted

Ah yes, I missed that comment in the header. And I can agree that a vertical line, by itself, does not offer a clear indicator on how to orient a profile.

 

 

 

To comment further, however, it seems that the correct orientation could be deduced from the previous and/or subsequent vector. That would certainly add complexity to the routine, but the effort may be worthwhile given that vertical sections do often occur.

Posted

Hi Seant,

 

As you have aptly pointed out, the inclusion of sweep for vertical members would make the lisp better.

 

I have examined this option during the drafting of the lisp, which I then decided against its inclusion.

 

The reason being that the distortion or the twist in circular members between a vertical members at certain condition would make the sweep alignment visually wrong.

 

Have a look at the illustration in the accompany pictures

 

The red circular members must twist 180 degree to achieve the original requirement of the directional profile at Y-direction to be facing upwards, no matter which cue we take from either the preceding or subsequent vector

 

Vertical Members Produce Undesired Results.jpg

However, if you still wish to include vertical members, you can break the sweep runs, before vertical members and sweep vertical members manually using AutoCAD command.

Posted

I have to agree the process would get ugly with that particular setup. See manual attempt attached.

 

Given that a user typically models something that needs to be built, that situation may not be all that likely.

Before I continue let me state that I understand the notion of developing routines to a specific need. Plenty of my own routines are only developed as far as I personally need them and have User Interfaces or other limitation that would make them unappealing to others.

 

Every now and then, though, I hit upon an idea that may be applicable to a wider user base, justifying additional development time.

 

The routine you have posted here looks to have that broader appeal. If the vertical sweep issue were addressed – to at least account for the run depicted in my first attachment – then I’d suggest posting it to a repository (i.e., Autodesk Exchange).

 

Perhaps, if a user attempts more ambiguous geometry – as you have posted above – then the routine can error out with an explanatory message.

Ugly2.dwg

Posted

Thanks for your comments.

 

 

I will look into inserting codes for vertical members when I have the time. I know it will be a challenge because of the many conditional statements associated, especially when doing it in 3D.

 

Meanwhile, please look into the attached PIPE3D.lsp. This is a sister to SECT3D.lsp, which is alot easier to code because of the symmetrical properties of circle, where twist is not a factor to consider.

 

I did a pipe run on your drawing using PIPE3D, and here is the result:

 

Orthogonal -PIPE3D Picture.jpg

 

Please read header in the lisp for more information.

 

Let me have your comments.

 

Thanks

Posted

Nicely done.

 

The combo 3DPolys, Fillets, and Solid Extrusions is still an item that Autodesk refuses to address in AutoCAD. I say “refuses” because it almost seems purposeful. Even AutoCAD 2012’s JOIN command is incapable of producing SWEEP viable geometry (see attached). I wonder if the upcoming 2013 version offers any other alternatives.

 

I have seen several clever ways with which outside programmers have bypassed the 3DPoly/NoFillet limitation. The methods typically employ some sort of piecewise processing, or faceted fillets. I’ve looked into the issue myself. See this post (You may have to register, but membership at The Swamp is well worth the effort):

http://www.theswamp.org/index.php?topic=30499.msg361666

 

Perhaps these lingering AutoCAD deficiencies are Autodesk’s way of keeping us outside programmers employed.:roll:

OrthogonalWithSpline.dwg

Posted

Glad to know that you like the Pipe3d.lsp. Let me know if you have any other comments.

 

I tried to open the drawing in AutoCAD 2011 and my Laptop hung (twice). Maybe your drawing version is 2012?

Posted
Glad to know that you like the Pipe3d.lsp. Let me know if you have any other comments.

 

I tried to open the drawing in AutoCAD 2011 and my Laptop hung (twice). Maybe your drawing version is 2012?

 

AutoCAD 2012, 2011 and 2010 all save as 2010.

 

It opened fine on AutoCAD 2011 for me.

Posted

Sorry my mistake. Yes, I managed to open it.

 

I should have said that AutoCAD froze when I tried to sweep the section along the spline.

Posted
Sorry my mistake. Yes, I managed to open it.

 

I should have said that AutoCAD froze when I tried to sweep the section along the spline.

 

Sorry about that. I hope it did not interfere with other open drawings.

 

In 2012, the Command immediately aborts with the statement “Unable to sweep 1 selected objects.”

Posted

No problem and no damage done.

 

I was wondered why I could not sweep as I wanted.

 

Anyway, thanks.

 

I am a member of Swamp.org now and read you posting. Agreed with you on 3Dpoly/fillet problems in AutoCAD.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...