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.

How to curl a sheet?

Started by MarkX, February 19, 2012, 12:09:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MarkX

Hi Phil,

Quote from: Dr PR on February 20, 2012, 10:32:44 PM
Mark,

The two attached pictures show how to drape a square over a cylinder.

That's AMAZING! That's pretty much what I was envisioning though I didn't realize it would be such trouble. Did you have to calculate and plot the sine wave by hand, or is there a way to do it automatically in DC?

Thanks!
Mark

Dr PR

Mark,

I love this sort of geometric challenge!

I am pretty sure it is possible to write a Macro to draw sine curves, but I did this the simple geometric way. The blue lines figure at the upper left has a polygon drawn with the "Draw/Circle/Circle" (center, outside) function, with the circle drawn as a 36 segment line. I drew horizontal lines from the 9 intersect points of the top right part of the circle. Then I drew a horizontal line for the length of the cylinder and used the "Draw/Ticmark" function to divide it into 18 sections. I drew the sine curve using the "Draw/Lines/Curve" (C) function, using the "Point/Intersect 2" function to snap points for the curve to the intersection of each tickmark and the corresponding horizontal line. It isn't a perfect sine curve (actually only 180 degrees worth of a sine curve) but it is pretty close.

****

The trick was finding the 0.3185 number. This is the ratio of the radius of the cylinder to the length of the cylinder (if the length is 1, the radius is 0.3185). It produces a sine curve that is asymptotic to a line with a 45 degree slope at the zero crossings (left and right ends of the curve). This is necessary if the resulting figure is to have 90 degree corners.

I have a bookshelf full of math books, and I am sure that somewhere in there is a formula for finding a sine that is asymptotic to the 45 degree slope, but I found it the hard way (actually, it was much easier for me than wading through dozens of math books!).

I created several instances of the subtracted solid from sine curves using height to period ratios from 0.25 to 0.5. I then measured the intersect angles at the upper and lower corners of the rolled square. I then plotted two curves relative to the ratios, using the angles of the upper and lower corners. The two curves crossed at 0.3185! This is the ratio (approximately) where all four angles would be equal.

****

What I have shown is a special case where the rolled square curves half way around the cylinder, but I think it can be applied to any degree of wrap around.  I haven't verified this by experiment .

If you extrude the sine curve to produce a "sine grid" and plot the intersect of the grid with a cylinder using "Draw/Lines/Surface Intersection" the result will be intersect lines that wrap around the cylinder. The cylinder should have the same radius as the magnitude of the sine (0.3185) but any length between 0 and 2.

Position two sine curve grids at the top center ends of the cylinder and find the intersections of the grids with the cylinders. These intersect lines should produce outlines of rolled squares that wrap around the cylinder between 0 and 360 degrees. At least the top corners will be about 90 degrees and I suspect the two curves will always intersect at about 90 degrees (proof left to the student).

For example, if the cylinder length is 2 the two intersect lines should meet at the bottom center of the cylinder, generating an outline similar to Bob P's rolled napkin.

Phil
DesignCAD user since 1987

Dr PR

It works!

I tried a few more examples using the "magic" sine curve and cylinders of varying lengths. In every case the four corners of the rolled square come together at 90 degrees.

The cylinders had radius 0.3185 as explained above, and lengths 2, 1 1/2 and 2/3.

In the first picture you can see the sine curve grids that result from extruding the line. In the top example you can see them positioned around the 2L cylinder, and then below that the cylinder with the resulting intersect line in black. To the right is the resulting rolled square with the lower corners touching.

Below that is a 1 1/2L cylinder and below that the 2/3L cylinder.

The second picture shows the rendered surfaces, including the 1L from the earlier example.

Phil
DesignCAD user since 1987

Pearco

You Dcad gurus continually amaze me with what you can do with Dcad.
Jim
User since ProDesign 1.5

Lar

#19
Hey, Phil, your shaded image makes a nice animation if you scroll up and down with the mouse wheel. Click on the thumbnail so it enlarges then use the mouse wheel to scroll up and down, sort of slowly, while keeping you eyes fixed at either the left or right side.

Anyway... dcad has always had a sine wave macro. I've pasted it below.

Do you know that a sine wave is a helix (spring shape) viewed sideways. This says to me that An oscillating wave is a force or energy that's spinning around a central axis while it's moving along that same axis (see attached image). If that's not already written in a book somewhere then I claim that as Lar's Theory of a Sine Wave in 3D.

You can also get a sine wave by painting a dot on the side of a wheel and rolling the wheel some distance (don't just spin it). If you track the dot you get a sine wave. This would be my 'theory of a sine wave in 2D' but I like the 3D one better. In fact, I won't be surprised if the 2D one is written in a book somewhere.

Lar
ps: I thought my theory deserved its own topic so I posted it here: http://forum.designcad.com/index.php?topic=4135.new#new


'Sine.d3m
'This sine wave macro problably was updated from the original BasicCAD version...
'I modified by combining 3 input boxes into one to eliminate tediousness (and adding a few notes) '...Seems like the 'LOOP:' should be called 'CANCEL:' because it jumps to the end if cancel is clicked.
'- Lar, 22Feb12

SYS(36) = 0       'Silent mode off (Normal)

SETPOINT "Set a point for starting location." 1
POINTVAL X1 Y1 Z1 1

INPUT "Enter Wavelength, Amplitude and Number of Waves (or Cancel to abort)... ", WAVELEN, AMP, NWAVES
IF SYS(999) = 1 THEN GOTO LOOP

'''INPUT "Amplitude: ", AMP
'''IF SYS(999) = 1 THEN GOTO LOOP

'''INPUT "Number of Waves: ", NWAVES
'''IF SYS(999) = 1 THEN GOTO LOOP

DX = (WAVELEN * 15/360)
X = X1 - DX

SYS(36) = 1       'Silent Mode on

FOR J = 0 TO NWAVES - 1
 >Curve
 {
   IF J >= 1 THEN <PointXYZ [X, Y, Z1]

   FOR K = 0 TO 359 STEP 15
     ' Set a point every 15 degrees

     X = X + DX
     Y = Y1 + SIN(K) * AMP / 2

     <PointXYZ [X, Y, Z1]
   NEXT

   IF J = NWAVES - 1 THEN <PointXYZ [X + DX, Y1, Z1]
   }
 NEXT
SYS(36) = 0     'Silent mode should be turned off at end of macro...

LOOP:


Dr PR

Lar,

The original trigonometrical idea of the sine function is the dot on a rotating wheel. That is what I used (the blue lines) to create my sine wave. Each horizontal line is connected on the left end to a "spot" on the circle corresponding to positions of equal rotation. The sine function is 2D.

Your "3D sine wave" is actually the spot on a spinning wheel while the wheel is moving along the axis of rotation - the sine propagated along a third axis. This is the definition of a helix. From the side (viewed in 2D) it looks like a sine wave.

As you know, you don't need a macro to generate a helix in DesignCAD. The "Sweep" function can do that, although I have never tried to make a helical line with it.

You could use your helix macro to create the lines for the rolled square.

Phil
DesignCAD user since 1987

Lar

Quote from: Dr PR on February 22, 2012, 10:27:09 PM
The original trigonometrical idea of the sine function is the dot on a rotating wheel. ...
...
Your "3D sine wave" is actually the spot on a spinning wheel while the wheel is moving along the axis of rotation ...
Doc, much of what you are saying here is being hotly debated in my link above (repeated here: http://forum.designcad.com/index.php?topic=4135.new#new)

Quote from: Dr PR on February 22, 2012, 10:27:09 PM
As you know, you don't need a macro to generate a helix in DesignCAD. The "Sweep" function can do that, although I have never tried to make a helical line with it.
Actually the Sweep command can only generate a Grid surface, as opposed to a line. You will have to vector convert the grid and delete the unwanted parts to get an individual line (don't explode the grid first or you'll end up with line segments).

The macro is actually for a sine wave. Of course, after extracting your helical line from the swept grid you can use our much touted flatten macro to turn the 3d helical line into a 2d sine wave.

Lar