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.

two-point planes

Started by bdeck, September 18, 2007, 10:52:08 PM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

bdeck

It should be possible to draw construction planes (for slice and mirror, for example) normal to the working plane by setting only 2 points when in 3D mode.    Requiring the third point creates a significant hardship, and introduces a significant source of potential error.


BD

prl

#1
Not sure I understand the parameters.  3rd point defines the xy plane position in 3d space of the new USC, otherwise you have an infinite number around the x axis 2 point line.

Which plane do you consider to be the default working plane when in 3d mode, XY, YZ, XZ?



for this discussion - say capital XY,YZ,XZ are the global planes; X, Y, Z the global axis directions
small xy, yz, xz are the local planes created by users with the 2d workplane command and  x, y, z are the local axis of the temporary UCS.

UCS - user coordinate system


edit: Maybe you are thinking about the sys(249) setting - 2D mode working plane [0=xy, 1=zy, 2=xz].  If yes, you can easily create your 2point plane command with basiccad now (rather than waiting another year).

You set the first two points of the >workplane command, and have a conditional check sys(249) and accordingly set the third point. Same approach for all the other commands (slice, mirror) that need the 3rd point to define the xy plane.



Edit 3rd time: 
Okay, maybe I got it now.  I confused myself with a test case where the user draws a line in 3d space.  See attached file.  The blue line is what got me.

slicetest.dcd


Anyway, I wrote some code using slice.  Here it is.  Try it with the solid in the file above.  This should be a start for you to massage it however you want.

'Program 2ps.d3m  (2 point slice)

setpoint "set two points to define slice, 3rd point portion to remove", 3

pointval x1, y1, z1, 1
pointval x2, y2, z2, 2
pointval xr, yr, zr, 3

sys(1) = 0

'fix the 3d points for the appropriate 2d mode working plane

x3 = x2
y3 = y2
z3 = z2

if sys(249) = 0 then 'XY - front view
  z2 = z1 'projection correction
  if z2 = z3 then 'already on working plane, offset to create 3rd point
     z3 = z2 + 1
  endif
endif

if sys(249) = 1 then 'ZY - right side view
  x2 = x1 'projection correction
  if x2 = x3 then 'already on working plane, offset to create 3rd point
     x3 = x2 + 1
  endif
endif

if sys(249) = 2 then 'XZ - top (plan) view
  y2 = y1 'projection correction
  if y2 = y3 then 'already on working plane, offset to create 3rd point
     y3 = y2 + 1
  endif
endif


>slice
{
  <selectonly 1
  <type 0
  <pointxyz [x1, y1, z1]
  <pointxyz [x2, y2, z2]
  <pointxyz [x3, y3, z3]
  <pointxyz [xr, yr, zr]
}

end






bdeck

#2
Hi prl,


Very nice.

I'll massage it for custom mirror.

Guess I'm just getting lazy, but it seems to me that your macro's behaviour should be the default behavior in DC for all such functions (custom mirror and custom slice are two that come to mind.)

Thanks,

BD

prl

Quote from: bdeck on September 19, 2007, 06:38:04 AM
but it seems to me that your macro's behaviour should be the default behavior in DC for all such functions

Gosh no!  Slice and all these things work. We know what happens when IMSI starts tinkering with existing features, the ratio of doesn't work/works spikes, never mind the domino effect on basiccad/ole, example - version 18 with dimensions.

bdeck

Quote from: prl on September 19, 2007, 07:05:35 AM
Gosh no!  Slice and all these things work. We know what happens when IMSI starts tinkering with existing features, the ratio of doesn't work/works spikes, never mind the domino effect on basiccad/ole, example - version 18 with dimensions.


prl,

Yes, kemosabe.

Macro good.

Change bad.

Mea Culpa.

BD