Lar's 'Extrude Along Curve' Method, 2005

Started by Lar, August 31, 2012, 10:23:28 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Lar

#15
Prl, you helix curve has that upward-turning condition I mentioned in my point-2 of my 2nd post. Like I said there: if the shapes can't miter together in the real world it won't look right in dcad, although it is (mathematically) correct.

In this case I would sweep the profile, as shown in the attached pic.

For irregular shapes that has to be precise I would duplicate the profiles along the curve (probably without using the 'array along a curve' command), reshaping them as necessary, then 'surface connect'. I have a number of methods and macros when using this approach. In cinema 4d you can employ what is called a 'rail spline' to control the extrusion in cases like this but I never got it to work properly. I would use one of my methods in dcad and export it to c4d.

Lar
ps: don't throw away the extrude method just yet... it does a good job of depicting the skin of a peeled orange, or a twirling ribbon going through turbulence.

prl

#16
Quote from: Lar on August 31, 2012, 02:26:45 PM
In this case I would sweep the profile, as shown in the attached pic.

Yes, for this example with a constant y axis the sweep will work but so should an extrude along a curve if we could define and maintain an "up" convention.  Another way to think of this is along any curve, we should be able to define the profile orientation and have the program extrude between these profiles.  A lofting approach I mentioned early.

Quoteps: don't throw away the extrude method just yet... it does a good job of depicting the skin of a peeled orange, or a twirling ribbon going through turbulence.
Lar, I always value your posts.  Your stuff is never wasted.

prl

More thinking on this.  Rather than an "up" control, I think we need a "horizon" feature that is defined by two points on the 2d profile. In the helical curve example, picture a small airplane with the nose up and tail down corkscrewing up in height as it ascends along the curve.  Picture how many different ways the wings can be positioned for this plane (360 degrees worth of options).

I generally want the wings to remain level (same Y elevation on either side of the wings) as it goes around and around  in circles, but from a profile concept, the wings could also be straight up and down, vertical.  Yes, I know, can't get lift like this but don't get technical about the plane aerodynamic lifting surfaces etc., think geometry and about a 2d profile with a left and right horizon control (the wings).

So in general 3d space with the exception of going straight up or down along the Y axis, this could control the "roll" of a profile along an arbitrary curve in 3d space.  For the pure vertical situation, one would need to define some other relationship since corkscrewing straight up or down always gives you level wings.

Dr PR

prl,

Good idea, and illustration. It works for the "Perpendicular" extrusion option. You could define roll, pitch and yaw relative to the direction of the curve at the point of the cross-section, but I'm not sure that anything but roll makes sense.

The other extrusion options seem to keep the object cross-sections oriented the same relative to the 3D axes.

Phil
DesignCAD user since 1987

prl

#19
Quote from: Dr PR on September 01, 2012, 10:50:05 PM
Good idea, and illustration. It works for the "Perpendicular" extrusion option. You could define roll, pitch and yaw relative to the direction of the curve at the point of the cross-section, but I'm not sure that anything but roll makes sense.

Yes, I think the aeronautical rotational terms helps us in CAD too.

In terms of a 2d profile, in my mind the pitch and yaw are locked to the perpendicular geometric plane of the path of travel (in our case the curve).  The pitch is automatically defined by the direction vector at the point of the curve and the yaw is zero.

The graphic is useful notwithstanding the Exis spelling.

prl

#20
For those that like to play around with the level horizon concept, the attached drawing has a random 3d curve with two extrusions in it.  I duplicated the curve twice.  The first one for the extrude along curve approach, the second for a lofting between a series of profiles along the curve.

After I made the solids, I moved each up 10 feet (Y direction) so you can see the original curve that created them.

The black solid was made using the ExtrudeAlongCurve command using the "Forward" setting using the appropriate 3 handles described in the Array command.

The red solid was extruded between the blue profile planes which are at the control points on the curve.  The blue profile planes are perpendicular to the curve at the point and the top of the profile has zero roll at those points.

Interesting to compare and lay one on the other.  The graphic SUOverlay.jpg is with these two solids shown in SketchUP.  The red is the level horizon solid, the white is the extrude-along-curve solid.  The view is from the end of the extrusion back toward the beginning.  The twisting in the extrude-along-curve solid is pretty severe.  The red solid shows what I prefer, the top surface is level at all the control points.

prl

#21
Here is an interesting discovery that may assist me in some future programming adventure.  Using the original helical curve drawing, use the Perpendicular Plane command and set two points on any one of the control points of the curve.  Do it with several of the controls points so you have several planes.    Then select one of the planes, open the infobox and look at the coordinates for the five points of the plane. Do it for another plane.  Notice the plane profile is always level (Y is constant for points 1 and 2, and points 3 and 4).  What this means is the plane is perpendicular to the curve so that it is pitched at the correct angle and the top line of the plane is level, similar to the airplane analogy (wings level, nose up and climbing or nose down for descending).

This is very useful.  One could remap the rolled grid profiles for a extrude-along-curve  to a level condition at each of the control points.  A winter programming exercise maybe unless I get distracted by something else.


Dr PR

This holds true for irregular curves also. In the attached image all of the squares have horizontal tops and bottoms.

DesignCAD has the code to find the horizontal orientation at all points along a curve. If it had an option that used this for the "Extrude along a curve" function the problem would be solved.

We could use this feature of perpendicular planes to orient cross section polygons along a curve for use with the "Surface Connect" function.

Phil
DesignCAD user since 1987

Lar

#23
Quote from: prl on September 08, 2012, 09:09:01 AM
Here is an interesting discovery that may assist me in some future programming adventure.  Using the original helical curve drawing, use the Perpendicular Plane command and set two points on any one of the control points of the curve.  Do it with several of the controls points so you have several planes. 
Prl. it sounds like you are suggesting what I tried to explain here (in this topic):
Quote from: Lar on August 31, 2012, 02:26:45 PM

For irregular shapes that has to be precise I would duplicate the profiles along the curve (probably without using the 'array along a curve' command), reshaping them as necessary, then 'surface connect'.

I would use three strategically placed handles on the profile to be duplicated around the curve (edit: if a curve entity or circle entity it would be vectorized) In the helix they would be at points 1, 2 and 3. For the last one I would select the one before and set 3 handles at the 3 descending points, since the last point of the helix has no further points to snap to.

In Cinema 4D the extrude-along-a-helix resulted in a shape very similar to dcad's. However, there is a 'parallel movement' option that 'corrects' the extrude.

Lar

prl

#24
Quote from: Dr PR on September 08, 2012, 09:03:05 PM
We could use this feature of perpendicular planes to orient cross section polygons along a curve for use with the "Surface Connect" function.

Exactly.  If a 2d profile is defined with four points as shown below, one can remap it to the perpendicular plane(s) along any 3d curve.

2d profile handle points.

(points 1 to 3 are in the plane of the profile)
point 1 - primary handle point, where profile connects to the curve control point.
point 2 - second handle point, defines horizontal (or roll angle if not horizontal, also points 1 and 2 define the plane pitch rotation axis)
point 3 - third handle point, defines the "plane" of the 2d profile (aka the pitch angle of the profile plane)

(point 4 is the "face this way" point, not in the plane of the profile)
point 4 - direction vector, say the next forward point on the curve - defines forward direction (so right side of profile is always on the right side when going forward along the curve)


Edit:

Explanation for using the 4th point.  In studying the helical curve example with many perpendicular planes sweeping around at least 360 degrees, I noticed DesignCAD sometimes places the plane with a clockwise point order and then at some position switches to a counterclockwise point order.  All the planes start (point 1) at the top line thought sometimes the beginning point is inside the curve, sometimes it is outside the curve.

Normally (3) points is sufficient to properly orient a 2d profile however this assumes the point order (clockwise or counterclockwise) is maintained at all control points.  Easier to just let the 3 points define the plane and use a 4th point to define the "face this way" position.

Edit 2:
"A file is worth a thousand words" - see the attached file.  The new curved arrows in blue show the point order of each of the perpendicular planes.  Seems for this example if the control point occurs in the 1st or 4th quadrant of the xz plane, the point order is clockwise.  2nd and 3rd quadrant in xz plane, counterclockwise.  This is too confusing for an arbitrary curve in 3d space, so I think the 4th point is simpler to understand.

prl

Quote from: Lar on September 08, 2012, 11:22:38 PM
I would use three strategically placed handles on the profile to be duplicated around the curve.

I'll admit sometimes things you write don't sink in right away. Or I just don't "get" what you are talking about.

Then at three in the morning at someday in the future I have a  "great idea".   :) 

Dr PR

I alos tried changing the helical curve to a multi-segmented vector. Even after setting the three handles, when I used "Extrude along a curve" the extrusion rotated. I even went to the trouble to make the object perpendicular to the first segment of the line, with the first handle on the line. Still no joy.

Phil
DesignCAD user since 1987

Lar

Guys, I created a flash movie to demonstrate how I would 'Surface Connect' around a helix, since 'Sweeping' has an undesirable result.
https://www.dropbox.com/s/gjce7dzmtkhv6kh/vid_Helix-how%20to%20sweep%20around%20one%20%28Sweep%20a%20helix%2C%20don%27t%20Extrude-Along-Curve%29_Lar-16jul14.flv

There's a lot going on and I don't have to explain it all at the moment I'll let you guys ask questions, if any ;D. One problem is the low frame rate makes the mouse movements jerky and somewhat difficult to follow (as well as me trying to do a lot quickly to minimize filesize). Many thinks are done for the sake of the recording, such as me not using shortcut keys.

The movie recording program appears to have a mind of it's own. What it did last time is not what it seems to be doing now. Hopefully clicking the link will open the movie and play it through Dropbox.

Here's the link to the native file, if you have the BB Flash player:
https://www.dropbox.com/s/n6tix6nkaq2vqb5/vid_Helix-how%20to%20sweep%20around%20one%20%28Sweep%20a%20helix%2C%20don%27t%20Extrude-Along-Curve%29_Lar-16jul.optimized.fbr

Lar

prl

#28
Quote from: Lar on July 16, 2014, 12:12:12 PM
The movie recording program appears to have a mind of it's own. What it did last time is not what it seems to be doing now.

When you agreed to optimize it (the fbr), FlashBack Express turned it into an Mpeg mode file and as you know Mpeg mode can't be used to make SWF files.

prl

Lar, if you post the helix follow-me path and the profile, I would be interested in trying my hand at that.