DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Extrude along a curve - handles

Started by samdavo, July 15, 2014, 01:43:23 PM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

samdavo

Just to make an observation about handles and extruding along a curve or line - and what I suspect to be a minor bug:- 
PS I am using V22.1 at the moment.

I wanted to extrude a shape (based on a rectangle with one chamfer) along a line (also a rectangle 12345)  such that the chamfer was on the far side and inside of the "window frame" that resulted. (In fact it's machined steel, but not important).   

I intentionally left the shape in a plane different to what I wanted it to be when extruded - just checking to see how powerful the handles were.

I note that Help notes for "Extrude along a curve (or line)"  refer you to "Array along a curve" for setting handles.
QuoteOrientation: Controls the orientation of the cross-section as it moves along the path. The options here are the same as those for Array Along a Curve (see Array).

and this in turn speaks of  the old option of using "perpendicular to extrusion line", and the new option(s) of
a) looking forward along the line or
b) backwards
(among others - eg fixed direction - always pointing east for instance)

... and setting handles for the plane or vector to be extruded with
1. first handle at the feet ("heels")
2. second handle to give refernce direction ( i.e. I imagine this means "toes")
3. and third handle to give which way was up, "head"

QuoteOrientation: The alignment of the object to be arrayed. For most of these choices to be used properly, you must correctly place your handles. Imagine the object you are copying is a man. The first handle is the man's feet. The second handle is the direction he is facing. The third handle is his head. His feet always touch the curve. His head is always in the "up" direction relative to the plane of the curve. He can walk forward or backward along the curve, or he can step along the curve sideways while facing to the left or the right of the curve. He can also slide along the curve while always maintaining his original orientation.

Note:  The curve's sense of "up" is calculated once for the entire curve; it is not evaluated separately at each point on the curve, so curves that do not lie in a plane may give unexpected results. Also, it may sometimes go in an unexpected direction. What you expected to be "up" might in fact be "down." (see next post) Be prepared to change your selection handles accordingly if you get unexpected results.

•   Original: Maintains the orientation of the original object, regardless of which direction the curve twists and turns. For this orientation, only the first selection handle is used; the copied object is never rotated.

•   Forward, Backward: The object along the curve so that it is always "facing" in a forward or backward direction along the curve. Objects rotate as they move along the curve to maintain their forward/backward orientation relative to the curve.

•   Left, Right: Moves each copy along the curve so that it is "facing" to the left or right of the curve's direction of travel.

•   Perpendicular: Treats the handles differently than other options. For this option, the plane created by the selection handles is always rotated to be perpendicular to the curve's direction of travel. This option gives the user very little control over the final orientation of the copy, and is retained for backward compatibility with older versions of DesignCAD.

So I defined the vector with
C for centre (heels),
D for direction ( a short line normal to the plane of the shape) 
and then T B L R for top, bottom, left, and right.

And then extruded around a rectangular line with options
CDTF = handles CDT and choosing extrude F orward
CDBF = handles CDR and Forward
CDLF, CDRF,
then back :-  CDTB, CDBB, CDLB and CDRB.

None of these gave the orientation I was after, and I only ended up with 2 variations rather than 8. 

I enclose a dcd. The eight options above are on the left

What I was after is shown on the right coloured green.
To draw it correctly, I simply

A>  orientated the plane correctly, (refer slightly to the right of the green extrusion, third jpeg)
B> and used CCCP = three handles at the centre, and extruded using the old "Perpendicular to line/curve"  - although Forward and Back give exactly the same result I notice.

Conclusion, I suspect there is something wrong with the "heel-toe - doe-see-doe"  handle method.
AND btw, I have no problem taking the couple of seconds to orient the plane correctly (which solves the problem) - Just making an observation.
(2 cents) 

PS I have sliced the various window frames so that you can see the section, and where the chamfer ends up.

samdavo

#1
PS I have underlined the sentence taken from the Help notes, viz :-

What you expected to be "up" might in fact be "down."

The reason?   simply a reminder to the Northern Hemisphere forum members of some the the laws of hemispherical up-and-down-ness.

(in other words, a pisstake :)  )

Also the fact that CCCP (disambiguation) was also the initials of USSR  (or a Windows filter pack)  is a coincidence :)

Wiktionary, the free dictionary.
СССР (Союз Советских Социалистических Республик) is a Russian (Cyrillic) abbreviation for the Soviet Union.

PS
CCCP may also refer to:
Combined Community Codec Pack, a filter pack developed for Microsoft Windows to play back rich multimedia content.

samdavo

#2
If you're interested, I posted CDTF above = extruding forward,

Here is CDTB = extruding backwards, for comparison.

It makes sense that the chamfer goes to the other side of the top, because forward vs back would do that (with this scenario) -

But you get the same result for CDRB - also just visible in that jpeg.   (Hence I suspect a bug).

CD seems to give direction ok,  (and forward and back works ok) - but the handle that sets "up" i.e. "head" is ignored.

... PS  or in other words, the 8 trial combinations CD** end up giving (only) two results/outcomes , CD*F  and CD*B  (neither
of which was what I was after) - cheers (PS all good :) )

prl

Sam, thank God for you, otherwise the summer doldrums.

The extrude-along-curve command you're exploring, your computer held over your head as alligators and snakes encircle you, is one of the great journeys as you head to the DesignCAD jungle uptopia known to a select few.   :)

I'll have to find it, but Lar did post a fairly consistent approach to taming this beast.


prl

#4
One of the links.  Who are these guys?

http://forum.designcad.com/index.php?topic=4580


Dr PR

Sam,

I didn't follow any of your long CCCDBJYS babble. However, I think I know what you are talking about.

There are two "variables" that affect the outcome of "Extrude Along A Curve." These are the point order of the 1) curve to extrude along, and 2) the line/plane to be extruded.

Often the extrusion comes out upside down or backwards, or both. When this happens, select either of 1 or 2 above, open the Info Box, and click the button with the red and blue arrows. This reverses the point order of the selected object.

You have four combinations:

1. Neither object reversed.
2. Extrusion curve reversed, extruded object normal.
3. Extrusion curve normal, extruded object reversed.
4. Both object reversed.

In many cases 2, 3 or 4 will cause the extrusion to work as you wish. In some cases it just won't work.

Phil
DesignCAD user since 1987

prl

#6
Sam,

The way I've tried to tame this beast is by using the following convention:

1.  2d profiles are always in the xy plane.  Their winding order is counter clockwise when viewed from front view.
2.  The +X direction define the right side of the profile, the +Y direction defines up, and the +Z  the extrude direction.  In other words, position it in the XY plane as you intend assuming it will be extruded in the Z direction.

A movie - A forward extrusion with 2d profile defined in the XY plane

Following these rules, using the FORWARD setting, the profile will extrude in the point order of the follow-me path,  1 to N.

Note I'm using a routine called pac.d3m  (profile along curve), that sets the handles points CDL for the 2d profile in the XY plane (even though it is asking for only one point, the C location.  The D and L points are added programmatically.)

The way I wrote the routine was so the only point I need to set on the profile (hence in my routine, the profile must be pre-selected), is where it will attach to the follow-me curve.

A movie - A second example using different attach to follow-me curve points.

samdavo

#7
Thanks prl,

When I do what you do, namely rotate the shape by -90 degrees about z axis,   then yes, I also get the correct result. 
But I have never considered setting a handle at D, nor drawing a short line normal to the plane of the shape to extrude (!?).
And when I say I also get the correct result, I do so without setting point D, in fact with either
a)  "Perpendicular"
b) "forwards" or
c) "backwards"

HOWEVER
if I rotate it +90 degrees I get a different - wrong - result (but again the same result for all three methods).

My conclusions are
1.  It is not worthwhile (in V22.1)  bothering to set point D, direction.  After all, this requires you to draw a short line normal to the plane of the shape (??) (edit) unless I have misunderstood the  "Help Notes".
2.  You are right, it is possible to get the correct result even though the plane of the shape is 90 degrees different to the extruded shape (i.e. the plane of the shape when finally extruded)
3. I always knew that :) - and , being old fashioned ( like Phil) I use Perpendicular
4. But it is tricky to know which way the shape will extrude,
5. And if you have the wrong orientation of the shape in the first instance, you are "snookered" - unless maybe you rotate it 90 or 180  degrees about z axis; and
6. Here's a "heads-up" :- The Help notes are totally wrong and/or "unproductive" imo - talk of "feet and "heads" = up etc.  (edit) Again, unless I have misunderstood the  "Help Notes".

PS YOU know the correct rotation etc direction ( eg -90 deg) which will work - whilst the other (+90deg) won't...   But I need to study your post better to see if I can understand that as well - at the moment I will use trial and error,  and/or just set the plane in the correct orientation and extrude that (as per the green option above)

prl

Quote from: samdavo on July 16, 2014, 02:09:29 AM
But I have never considered setting a handle at D, nor drawing a short line normal to the plane of the shape to extrude (!?).

Well both programmatically and manually, I've merely adopted this convention becomes I know what will happen.  All the other combinations and settings, I gave up on.   And I'm guessing the original coders assumed that convention too.

prl

#9
Also, the "Forward " is the only one that makes sense to me.

1=Forward -- orientation so that an arrow from handles 1-2 points along the direction of the curve, and an arrow from points 1-3 points "upward" from the plane of the curve


By creating the profile in XY  I can picture the "up" of the profile and the "forward" extrusion (in Z).  My code simply hides all the confusing terminology by only asking for the point for extrusion/sweep attachment.

prl

#10
And here is a "twist" for you to experiment with.  A curve that climbs in y elevation.  A sidewalk profile given to you.  You want to create the ramp in blue, lest all the people fall off the ramp.    The red is with extrude along a curve command.


samdavo

#11
Thanks - I extruded it - but not sure what I have lol.  (I simply extruded along the curve formed by the lowest edge).
(edit) There is still a (minor) change of (y) across the width of the track. 

I suspect your red "super-elevated cycleway" is more difficult - and more clever (?)

Further experimentation required.

PS Imagine how fast the Racing motorbikes would go if they had that sort of super-elevation ? :)

prl

Quote from: samdavo on July 16, 2014, 04:43:46 AM
(I simply extruded along the line formed by the lowest edeg).

If you move the red and blue extrusions out of the way, you'll see the original follow-me line, on layer 1 (I think).  Yes both extrusions are hooked to the follow-me line at the bottom edge of the profile.

samdavo

#13
prl
Appreciate a tip on how you did the red curve
It can't be simple surface connect between inside of curve and outside  because there's a kerb there on each side (??)

ok , thinking about it - maybe a longitudinal surface connect. (?) 

prl

#14
Quote from: samdavo on July 16, 2014, 02:14:08 PM
Appreciate a tip on how you did the red curve

The red one is the simple one. Movie below.  (The blue one is special because I leveled every profile frame.)

A movie - The red extrude-along-a-curve