axis of revolution for concerned predefined solids

Started by JJG, July 19, 2012, 06:02:44 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JJG

In conection with this topic :    http://forum.designcad.com/index.php?topic=4532.0

I think it would be helpful that IMSI / Design adds this representation of the axis of revolution to the concerned predefined solids, such as one can found it in many other Cad-softwares : this would greatly simplify the user's work.

And by the same token, simultaneously, offer to us the 3rd possibility of Construction Lines, ie between 2 points only, which may be very useful too.

Bob P

Unfortunately, it might look like a cylinder but DC can only create solids bounded by flat surfaces.  Not really a cylinder.  I use this macro to create "cylinders" that also have a central axis for reference.  (Attribution unknown...)  Much more intuitive than the standard cylinder command.

'Creates cylinder along line
'Program: cyl2.d3m (Cylinder along line)
precision 15

dx1$=sys$(0)
if dx1$ <> "" then goto skip

' Get User Input
dx1$=sys$(0)
if dx1$ = "" then input "Enter cylinder radius: ", dx1$

skip:

dx=val(dx1$)

input "Enter the number of cylinder facets: ", facet$
facet=val(facet$)

if sys(1) <> 2 then
sys(1)=0
setpoint "Point 1 for cylinder origin, point 2 for cylinder length " 2
endif
'sys(36)=1

pointval x1, y1, z1, 1
pointval x2, y2, z2, 2

sys(1)=0

>line
{
<pointxyz [x1, y1, z1]
<pointxyz [x2, y2, z2]
}

w = 2*dx
>PerpendicularPlane
{
<Width [w]
<pointxyz [x1, y1, z1]
<pointxyz [x1, y1, z1]
}

Entity Sys(9) ' Get the points for the square plane just drawn.
' only need the last two points

tp=sys(1)
tpm1=tp-1
Pointval x3, y3, z3, tpm1
Pointval x4, y4, z4, tp
sys(1)=0

'compute radius point location using two edges of plane
xr=(x4-x3)/2.0 + x3
yr=(y4-y3)/2.0 + y3
zr=(z4-z3)/2.0 + z3

>EraseLast 'remove the perpendicular plane
{
}


>Cylinder
{
<Orientation 0
<Nface [facet]
<pointxyz [x1, y1, z1]
<pointxyz [xr, yr, zr]
<pointxyz [x2, y2, z2]
}
End


prl

Quote from: Bob P on July 19, 2012, 06:42:58 AM
Unfortunately, it might look like a cylinder but DC can only create solids bounded by flat surfaces.  Not really a cylinder.  I use this macro to create "cylinders" that also have a central axis for reference.  (Attribution unknown...)  Much more intuitive than the standard cylinder command.

If all my computers blow up, I know who has been keeping good notes (and improving them).  :)  From 2004 . . . .

Dr PR

Bob,

Your macro is similar to how I have been drawing cylinders at odd angles for many years. I draw a line for the cylinder axis and then snap a perpendicular plane at one end of the line. Then I set the radius of the cylinder by snapping to the midpoint of an edge of the perpendicular plane. The perpendicular plane trick is the key to getting the new cylinder aligned along the desired axis.

The only problem I have found is that I can't control the orientation of the perpendicular plane. That means the radius point of the cylinder often isn't where I want it.

If a cylinder is to be used in a Boolean function with another cylinder it is often best to align the second cylinder so the facets of the two cylinders have common edges. This makes creation of the second cylinder a bit more problematic, but it can be accomplished with a more complicated geometrical construction.


****

Having the program do the calculations would be a better way to accomplish this, as JJG suggests. I would implement it this way:

1. Set a point at one end of the cylinder axis.

2. Set a point in the direction of the radius point (relative to the first point). The first three points would establish the plane that the radius point should be in.

3. Set a point at the other end of the cylinder axis.

4. Set the radius length. The program would find the radius point along a line perpendicular to the cylinder axis and in the plane defined by the first three points.

5. Set the number of facets.

6. Finish the cylinder.

****

You can find the radius point by drawing a perpendicular line from the end of the axis, with the defined radius length, in the direction of the second point. This allows some control over the orientation of the cylinder facets.

Phil
DesignCAD user since 1987