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 create a plane perpendicular to line?

Started by MarkX, May 28, 2012, 04:08:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MarkX

This is something that comes up so frequently.

Let's say you have a non-orthogonal line (that means it doesn't match the X, Y, or Z axis).

You want to create, for instance, a circular plane that runs along the line that you can then extrude to form a pipe.

How do you create a plane perpendicular to the line?

So far, what I've got is that you can set a workplane. Then use that as the base for your operations. I've just been told that until recently setting a workplane can create problems, though I don't know what they were / are and having been using this technique  blissfully unaware.

The other technique is to create a line running along the original line, rotate it out 90 degrees by one end, and then construct your own plane in a series of steps around the original line, and finally rotate the new plane around one of its own axises.

Is there a quicker, better way than either of these approaches?

Thanks!
Mark

prl

#1
Sure, use Basiccad.


'Program: PP2L.d3m (Plane perpendicular to line)

precision 15

input "Enter size of square plane, example 9""", dx1$
w=val(dx1$)

setpoint "Set two points on line.  Note plane will be drawn at first point ", 2
pointval x1, y1, z1, 1
pointval x2, y2, z2, 2

if sys(1)=0 then END

>PerpendicularPlane
{
 <Width [w]
 <pointxyz [x1, y1, z1]
 <pointxyz [x1, y1, z1]
}
End



Also I should add you can do this using the menu command  Draw>Planes>Perpendicular Plane

Bob P

Once you've created the perpendicular plane, you can create the circle through 3-pt circle.  Note that the diameter of the circle is sqrt(2) times the plane's edge length.  I have a DOS macro to do this automatically, but haven't got around to a Windows version.
'This creates a perpendicular cirle on a line
IF SYS(1)<2 THEN GOTO SETP
POINTVAL XL YL ZL 1
POINTVAL XC YC ZC 2

DOIT:
DIM X(5), Y(5), Z(5)
INPUT "What circle radius? " R
>PPLANE [R*1.414]
ENTNUM=SYS(9)
ENTITY(ENTNUM)
SYS(1)=3
FOR J=1 TO 3
POINTVAL X(J) Y(J) Z(J) J
NEXT J
SYS(1)=0
>UNDO
FOR J=1 TO 3
>POINTXYZ [X(J), Y(J), Z(J)]
NEXT J
>C3
GOTO END

SETP:
'SYS(1)=0
SETPOINT "Set a point on the line and a point at the circle center " 2
POINTVAL XL YL ZL 1
POINTVAL XC YC ZC 2
GOTO DOIT

END:

MarkX

Hi Prl,
Quote from: prl on May 28, 2012, 04:40:07 PM
Sure, use Basiccad.
...
Also I should add you can do this using the menu command  Draw>Planes>Perpendicular Plane

Gosh I wish I remembered that  :-[. I guess it hasn't always been around if you have a macro ready to do the same thing.

Quote from: Bob P on May 28, 2012, 05:58:43 PM
Once you've created the perpendicular plane, you can create the circle through 3-pt circle.  Note that the diameter of the circle is sqrt(2) times the plane's edge length.  I have a DOS macro to do this automatically, but haven't got around to a Windows version.
'This creates a perpendicular cirle on a line
...
END:

Thanks Bob.  I think I'll squirrel this away, but try to remember just the SQRT(2) thing. My problem with macro solutions is that I have to remember:

  • 1. That I have the macro
  • 2. How it works.

Thanks everyone!
Mark

prl

#4
Quote from: MarkX on May 28, 2012, 07:42:23 PM
Gosh I wish I remembered that  :-[. I guess it hasn't always been around if you have a macro ready to do the same thing.

:-[ Well admittedly I always jump to my basicCAD library of routines but as BobP has reminded me with the legacy DOS basiCAD code (the good ole days), this function >(PPlane) and menu command have been around for 20+ years.  DesignCAD was truly remarkable and ahead of the game in the early days.  

As far as remembering macro names or menu names for that matter, yeah I suffer that problem too.  And I don't just do DesignCAD. I do not favor menus, dialogs, toolbars, ribbons, etc.  Obviously the world likes the soft pretty eye candy stuff, . . .

Also, I should add, if your post is about automating drawing a cylinder or rod along the length of a line, I've written the code to do that too. Let me know.

Bob P

You can create the correctly-sized square plane directly in the size dialog box of PerpPlane:

(Your diameter)/sqrt(2)

Bob P

See my PerpCircle macro in the BasicCad section.

Dr PR

Mark,

I'm a bit late to this discussion, but I have been creating circles and circular planes perpendicular to lines for many years using the following technique. After a few times it is almost automatic.

1. Use "Draw/Planes/Perpendicular Plane" to place a perpendicular plane at one end of the line.

  a. Set the "Plane Width" to the diameter of the desired circle.

  b. Point and left click on the line to select the line.

  c. Gravity snap to the end of the line to set the position of the plane.

2. Draw the circle (Draw/Circle/Center-outside):

  a. Gravity snap to the end of the line to set the circle center.

  b. Use the Midpoint function to set the circle radius at the midpoint of an edge of the plane.

  c. Gravity snap to a corner of the plane to set the plane of the circle.


NOTE: If you want a cylinder you can skip the circle part and just set the cylinder radius as described and gravity snap to the other end of the center line to complete the cylinder.


****

The only problem I have found with this method is that you can't control the orientation (rotation) of the original plane around the line. This is an issue only for subsequent drawing operations that require the radius point of the circle to be oriented in a particular direction. This can be important for some extrusions or if you will use the circle as a template for Surface Connect.

To solve this problem draw a line perpendicular to the original line (for example, from a corner of the plane to the line) and rotate it around the original line as desired. Then find the intersection of this line with the circle and use this point to draw another circle with the radius point at the intersection.

Phil
DesignCAD user since 1987