Four leaf clover exercise

Started by samdavo, January 30, 2015, 05:02:30 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

samdavo

Drawing a 2D four-leaf clover.
This is intended as a written tutorial for beginners.
If you end up drawing the 4-leaf clover, you should probably consider yourself lucky :)

Put the enclosed macros in Q\File locations\macros

1. Screen colour:-
Q\Colour\Background = black, rgb = 000
You will have a black background.
(or you can do this by hitting spacebar, typing "nite", then enter - this will run the macro "nite.d3m").

If you prefer you can try / compare "day.d3m"  which gives you a white background

2.  Load Image:-
Go to Menu \File\Image\Load Image File, select  fourleaf clover,  click to place in drawing.

3. Set working layer and corresponding colour to 4, limegreen:-
Run macro "4.d3m", which will set current layer to 4, and current colour to lime-green (on white background).

Hit "V" key (for vector), try to trace the outline of a leaf - if the rubberband line is locked on ortho-x or y axis, then hit "H" to release ortho-mode.  Make sure that lines make closed areas (because we are going to hatch these areas).

{edit) Select the trace-lines, and use hotkey 'N' to copy this to the side.

4. Set All layers editable:-
Run macro "a.d3m"  (Spacebar,  a,  enter)

5. Mirror the entire leaf-trace-lines about the vertical axis, i.e. in horiz dirn:-
To do this, select the entire multilayered single leaf, type "%" to open all macros, choose "mirror horiz.d3m", click it, click a handle at the base of the leaf, it will automatically mirror the leaf in horiz dirn.

6.  Mirror the two leaves in the vertical dirn:-
Select the pair of leaves, type "%" to open all macros, choose "mirror vert.d3m", click it, click a handle at the junction of the leaves, it will automatically mirror the leaf in vert dirn.

7. Set working layer and corresponding colour to 3, brown:-
Run macro "3.d3m", which will set current layer to 3, and current colour to brown.

Use "V" to trace the yellow/brown area of a typical leaf, using hotkey "K" to ensure the start and end of each line is on another line (i.e. the radiating ribs of the frond pattern). 

8. Hatch the areas of leaf:-
Use Menu\Draw\Hatch\Hatch Fill, choose WIN_SOLID
Whilst working colour is brown, place a dot on the middle of the area to be coloured that colour.

Change to lime green by using 4.d3m
Hatch fill the other areas.
To make the areas on the left a darker version of green, select one of the hatched areas,
Open Infobox, click the colour icon, choose another colour, eg a darker green.
Choose another lime hatched area, use the finger to achieve "Same As",  and then click the darker green area.  The lime area will change to dark green.

9. Change the "vertical" scale of the bottom two leaves:-
Select the bottom two leaves.
Make the centre of the pattern the handle - using Ctrl+H. (Just the one handle on this occasion).
Go to Edit\Selection Edit\Scale,  and change the scales to X = 1,  and Y = 0.75.
The lower two leaves will "shrink" vertically.

End of exercise.

samdavo

#1
Here's the same /similar thing applied to a 2D symmetrical shape.  Basically you can draw one quadrant, and then mirror it about both x and y axes (or indeed do that about both concurrently with one macro).  We will introduce some scaling and dimensional accuracy.

1.  Draw some construction lines for boxes:-
Click on the "box" in the main toolbox.  In 2D, this draws a rectangle.  (In 3D it draws a cube - ignore for now).
Make the current layer 1 and colour white - use macro 1.d3m which will achieve both of these.
Set a point (called O).  Press the " ' " apostrophe key, (left of the enter key), which brings up point relative.  Choose x = 200 and y = 300.  You should have a rectangle 200x300 high  (OABC).    Click Ctrl+W to fit the screen.

Draw another rectangle starting at B, and point relative becomes x = -100, and y = -120.

2.  Draw construction lines for location of circles:-
Press V (check it isn't in ortho mode, if it is press H) - draw lines from O with relative xy distances of (130, 100);     Also (100,250).

3.  Change to layer 2 and red. (use macro 2.d3m)
Trace the outline you want (red over white),
Use Draw\Pointmark to set a red point at O.

4. Change to layer 4 and green (use macro 4.d3m)
Draw a circle based at the ends of the two lines radiating from O.
To do that click "O" (for circle), choose circle rather than vector or plane, click the centre,  use point relative to set the radius,  (20, 0). Enter gives you a circle.

5, Go back to layer 1 (only), using 1.d3m.
Drag the selection box around the quadrant, and select all temporary construction lines (only), in fact everything white.  Delete that set of lines.

6. Go to all layers with a.d3m.  Add a chamfer or two (30x30) and a radius (30R) - using Edit \ Trim \ Chamfer,  or Fillet  - check out Hotkeys  Shift F etc which are listed there as alternatives to the long route through the Menu.

7. Select the entire quadrant, and mirror it about both x and y.   
Either use "Mirror horiz.d3m" followed by mirror "vert.d3m" .
Alternatively use "B4.d3m" (enclosed).  With this you run the macro, then set a single point at O.

end.


samdavo

#2
OK at risk of going too fast or too far into left field, we step up to a 3D leaf. (No need to go there if you want to stick with 2D).

I am assuming that the shape is somewhat "truncated trumpet" shaped.
Hence
1.  Sketch some curves in 2D (with Draw\Line\Curve), layer 3, brown - see first jpeg.   These will be the basis of a Surface Connect later, so it is important that each of them has the same number of points ( 5 in this case).  These will be radiating ribs of the leaf.

2. Go to 3D, select one of the ribs (the centre one remains in the XY plane, so pick the "next one up").   Make the handle at the low end  (using Ctrl+H).   Rotate this by hitting "R", and choosing a 30 degree rotation about the Y axis.    Choose the next rib, and rotate it 60 degrees.

3. Mirror those two ribs in the Z direction, i.e. select the two ribs,  Make the handle at the low end (of both),  Press "/"  choose "mirror normal to Z axis", you end up with 5 radiating ribs, all curves with 5 points each.   

4.  To get a fan-shaped grid, go to Draw\Surface Connect,  and click on the outer end of each of the 5 ribs.  You should have a brown fan / grid.

5. Meanwhile, back in 2D, sketch the outline of a leaf (I have opted for a more irregular outline than the cloverleaf), layer 4, green.   (Draw\Line,  or "V").   Draw half of it, and then mirror this about the X axis (using "/") to have 2 lines.  You need both lines to be combined into one (using "B", or Edit\Selection Edit\Combine Lines).   Then you will be able to select the outline with one click.  Do that, and press "space, mp, enter",  where mp = make plane.

6. Rotate this green leaf-shaped plane 90 degrees about the x axis.

7. This shape is going to be effectively a biscuit cutter to trim the grid to the outline of the leaf.
Extrude the leaf vertically, by drawing a (fairly long) vertical line;  then selecting the leaf, then putting a handle at one end of the line, then using Extrude-along-a-line" using Ctrl+Shift+X.    You should now have a prismatic solid leaf.  If it is unexpectedly "back-to-front", then Undo ( with Ctrl+Z), choose the line, go to infobox (Ctrl+I), press the red-and-blue-arrows to reverse the direction of the vertical line.    Try again, and hopefully it is / should be an extrusion directly above the green plane that you started with.

8. Select the extruded leaf, draw a short horizontal line in the negative x dirn from the low left , make the handle this point at the low left;  and move this to be superimposed on the radiating point of the radiating ribs.

9. You need to have the part that is common to the green left extrusion ( a solid), and the brown fan (a grid).
First select the grid, and make it a solid with Ctrl+D = Solid Define.  You now have two solids to play with.
You need to use Solid\Solid Intersect to find what is common to both solids.  Click on both solids.  As you click the second solid, you should have just the common curved leaf (plus maybe the original green leaf plan at the base).

PS I ended up with a couple of grey patches in the otherwise brown leaf (layer 0) - not uncommon for complicated grids - If you select everything,  brown and grey on the leaf,  and change to brown, you should sort this out.

samdavo

#3
Herewith the same thing done with the "symmetrical shape".

I will go to the final result without the intermediate steps.  Should anyone be interested, I will add more steps.  (Clearly you make planes of each of the green circles and red planes -  and extrude all - and use Solid Subtract to delete the green holes from the red plate).

But I will add the macro qs2.d3m, (another by prl) - which is great for showing 3D objects ( both shaded and lines-around-edges)

samdavo

#4
...
three leaf clover ...
(using circular array
and playing around with Q\ Light Source \ shadows on) - 2 cents

Then there is texture mapping , eg  Tools\Texture mapping\box mapping\top  .

samdavo

#5
Just trying to get rid of those aluminium-layer-zero facets on those leaves - I was changing the layer from 0 to 4, as per the rest of the leaves - but it was not till I selected the entirety of the leaves, and found that material (in infobox) was "multiple" did I twig to what I still had to do.   On this occasion I have chosen material "gold" to get uniformity for the leaves.

Thanks Phil for this post from the archives
Reply #3 here http://forum.designcad.com/index.php?topic=3812.msg21223#msg21223 , reproduced below.

Quote from: Dr PR on July 12, 2011, 07:36:10 AM
Dean,
This is a known bug in DesignCAD - it's on the "to do" list.

Quite often when the solid Boolean operations are performed bits and pieces of grids are moved to Layer 0 (zero). In addition, the material is changed (usually to "Aluminum").

All you need to do is disable all layers (Layers dialog, or "L") except the layer the grid is on and Layer 0. Then select the grid, open the Info Box (CTRL I), and the layers box will say "Multiple." Pull down the layers list and select the layer that the grid was on ofiginally. Now all parts of the grid will be on the one layer.

Next, while the grid is still selected,  look at about the middle of the info box. There is a square window with a shaded sphere in it. This shows what the material of the object looks like - it will be colored in four quadrants to indicate that there are multiple materials in the selected object. In the "Material" box click the pull-down button to open the list of materials and select the material that the grid should be.

Finally, if the material is "Default" you may need to click the color tile at the left end of the tool bar near the top of the Info Box and select the color you want the grid to be.

It is a nuisance to have to do this, but not a lot of trouble. Lets hope this one gets fixed soon. I NEVER use Layer 0 for anything, leaving it to be the garbage collection layer for the solid Boolean operations.

By the way, on one occasion the wayward grid segments ended up in a higher numbered layer than any in use in the drawing. I have seen this only once. If you select a grid and the Info Box says it is on multiple layers, and the Layers dialog says Layer 0 is empty, you will have a bit of an Easter egg hunt to discover where the odd bits and pieces fell. The easiest thing to do is select the grid, enable and unlock all layers, and then use the Info Box to move all of the grid back to one layer.
Phil

PS keywords added :-
sd=KWaluminium   sd=KWaluminum