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 the bottom corner of a page.

Started by Lar, February 21, 2012, 06:39:27 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Lar

To curl the bottom corner of a page in 3d mode (see attached jpg and demo files):
1] Draw the page by creating a Plane surface in the XZ plane...
2] Create diagonal segments (Planes, as in the attached jpg) at the edge to curl, the more segments the smoother the resulting curl...
3] Chamfer off the edge of the original full page where the segments are and rotate everything 45 deg(Y) to facilitate the upcoming rotations in the X axis...
4] Select the bottom segment, set the handle at one of the inner points and rotate 45 deg upward (315 deg in the attached drawing) in the X axis...
5] Keeping the first segment selected, select the 2nd segment and set the handle at one of its inner points...
6] Rotate as in step4,
Repeat steps 5 and 6 for each of the remaining segments.

To see this process in action download the attached dcd drawing and macro file (d3m). Open the drawing and without moving anything run the macro. The macro curls and then uncurls the page so you can try it yourself.

When satisfied group all the planes together to make one curled edge page.

The macro includes the following to create a delay between steps:
count=0
for delay=1 to 150000
count=count+1
next


If the delay is too long on your computer reduce the 150000 to something appropriate.

Lar

MarkX

Hi Lar,

Nice demo! How would someone write the macro so that it could step through existing planes one by one, rather than using the hard-wired values? Is there a way to say "Go to next object" in BasicCad?

Also, please pardon the digression, but how did you get the zoom controls and angle constraints to show up on the non-main windows? They only show up in mine in the main window.

Thanks!
Mark

Lar

#2
Thanks, Mark. This demo was actually done for your post on curling a square (http://forum.designcad.com/index.php?topic=4128.0) but I thought you meant curling a corner like when turning a page. I actually removed it from there and posted it here in Tips and Tricks.

Quote from: MarkX on February 21, 2012, 10:11:41 AM
... How would someone write the macro so that it could step through existing planes one by one ... ... Is there a way to say "Go to next object" in BasicCad?

Entity id:
If you select a group of objects basiccad can iterate through the selection in the order they were created, ie - using their id numbers. To set the handle, if the strips of planes were created in the same way so that their point numbers ran in the same order, basiccad can get the coordinates of an entity's point of interest then set the handle there. This method would rely very heavily on the creation order and point order being maintained. Essentially, if the results are not as expected then undo and correct the entities. This is what happens when the surface connect command goes bad and the resulting surface ends up twisted - the user has to find the line with the opposite point order and reverse it (with the info box, for those who don't know).

There is another method I would use for myself, suited to my work preference, but it's too long to explain and may sound like too much effort for others.

Quote from: MarkX on February 21, 2012, 10:11:41 AM
... how did you get the zoom controls and angle constraints to show up on the non-main windows? ...
Sounds like you only have 'scroll bars' active for the main window. What to do is make a window active by clicking in the title bar then left or right click in the empty part of the status bar (or right click on a toolbox) and a menu list of available toolboxes (and a few other things) will pop up. Click 'Scroll Bar' and all that stuff will appear. You'll have to do this for each window one at a time.

Lar

Dr PR

Lar,

Very nice.

Now, can you create a macro to flatten a curved surface? How about a truncated cone?

Phil
DesignCAD user since 1987

Lar

I remember that coming up in a topic recently and describing how to do it but never got to actually write it. If the source object is a grid which the macro explodes it should be easier than curling since the segments and points will surely be in order. The user would have to set the first few points since there would be an infinite number of possible shapes involved.

I'll see what I can do about writing it. The curling macro was recorded as I manually selected the necessary segment, set the handle then rotated, one by one. I added the layer stuff and delay afterwards.

Lar

paul craig

lar, what would be really useful for me is a macro to allow me to flatten a surface that intersects a cylinder.

some of my model engines have what we call splashers, which are kind of like loco mudguards, and the intersect the boiler, t'would be nice to be able to produce the kind of ellipse that it produces.

paul

MarkX

I've made a version of the curling macro that should (hopefully) work with any set of planes and allow you to change angles.

Have fun,
Mark

From the documentation:

' Open the drawing file 'PageCurlDemo_MAS_V02b'
' Open up the Rotate dialog ("R") and turn off drag mode.
' Run this macro to see the page curl in acton.
' You can modify various aspects by changing variables
' marked PUBLIC below
'
' TO MAKE YOUR OWN PLANES:
'Each plane must be assigned a name that follows the
'form "foldXX" where XX is a two digit number. The
'folding will start with the lowest numbered plane and
'continue up to plane 99. You can change the base stem
'name (e.g. "fold") in variable gcFoldStem$ below.
'----
'WARNING 1: You may need to set a workplane to match the
'set of planes you wish to curl. This is due to a subtle
'bug in ROTATE that appears to exist in DC 21.1 and possibly
'other versions.
'WARNING 2:
'Keep all comments on layer 2 which will be turned off while
'the macro runs (enhances display speed).