Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

CUTPLANE from Plane Normal

Danny Sparks-Cousins
Contributor
Hi,

Can anyone please tell me how to use the additional [x,y,z] parameters in the CUTPLANE [x, y, z] command. I wish to define a cutplane for a plane that I know 3 x,y,z points for.

I can work out the equation and normal for the plane using the 3 points but dont seem to be able to use the resulting information within the CUTPLANE [x,y,z] command correctly.

Any help would be greatly appreciated.

Kind Regards,
Danny
5 REPLIES 5
Frank Beister
Advisor
The x, y and z represent the break through points of the three axis on the curplane. If you have the plane equation

ax + by+ cz + d = 0

You can set y=0 and z=0 to get the point on the X axis. Similar for the both others.

Maybe you will need a fourth parameter. If you add a "1" at the end, the cutting direction will be flipped.

Can you maybe post the whole formula for the three points?
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Danny Sparks-Cousins
Contributor
Thanks for the pointer - I tried applying it to my situation but am still a little stuck - perhaps I have something wrong in my plane equation.

As requested I have posted below my script. I have put all the information and calculations together so this can be copied straight into the 3D script.

Thanks again for your help on this problem.

Kind Regards,
Danny

!-----SET SIZES-----
len=1.0
dep=1.0
wall_thk=0.090

!-----SET POINTS-----
x1=0.0 : y1=0.0 : z1=0.3
x2=1.0 : y2=0.5 : z2=0.6
x3=0.0 : y3=1.0 : z3=0.3

!-----CALCULATE VALUES FOR PLANAR EQUATION-----
co_a=(y1*(z2-z3))+(y2*(z3-z1))+(y3*(z1-z2))
co_b=(z1*(x2-x3))+(z2*(x3-x1))+(z3*(x1-x2))
co_c=(x1*(y2-y3))+(x2*(y3-y1))+(x3*(y1-y2))
co_d=-((x1*((y2*z3)-(y3*z2)))+(x2*((y3*z1)-(y1*z3)))+(x3*((y1*z2)-(y2*z1))))


!-----CALCULATE POINTS FOR CUTPLANE-----
IF co_a#0.0 THEN
x_cut=-co_d/co_a
ELSE
x_cut=1.0
ENDIF

IF co_b#0.0 THEN
y_cut=-co_d/co_b
ELSE
y_cut=1.0
ENDIF

IF co_c#0.0 THEN
z_cut=-co_d/co_c
ELSE
z_cut=1.0
ENDIF


!-----DRAW OBJECT WITH CUTPLANE-----
CUTPLANE x_cut, y_cut, z_cut, 0

PRISM_ 9, 5.0,
0.0, 0.0, 15,
len, 0.0, 15,
len, dep, 15,
0.0, dep, 15,
0.0, dep-wall_thk, 15,
len-wall_thk, dep-wall_thk, 15,
len-wall_thk, wall_thk, 15,
0.0, wall_thk, 15,
0.0, 0.0, -1

CUTEND

END
Frank Beister
Advisor
Done very well, but you trapped into one definition lack:
The three ordinates may not be zero, because these special cases built up a cutplane parallel to one of the three axis.

Try this (copy it to MASTERscript to get PRINT to work).
!-----SET SIZES-----
len=1.0
dep=1.0
wall_thk=0.090

!-----SET POINTS-----
x1=0.2 : y1=0.0 : z1=0.3
x2=1.0 : y2=0.5 : z2=0.6
x3=0.0 : y3=1.0 : z3=0.3

!-----CALCULATE VALUES FOR PLANAR EQUATION-----
co_a=(y1*(z2-z3))+(y2*(z3-z1))+(y3*(z1-z2))
co_b=(z1*(x2-x3))+(z2*(x3-x1))+(z3*(x1-x2))
co_c=(x1*(y2-y3))+(x2*(y3-y1))+(x3*(y1-y2))
co_d=-((x1*((y2*z3)-(y3*z2)))+(x2*((y3*z1)-(y1*z3)))+(x3*((y1*z2)-(y2*z1))))


!-----CALCULATE POINTS FOR CUTPLANE-----
IF co_a#0.0 THEN
x_cut=-co_d/co_a
ELSE
x_cut=0
ENDIF

IF co_b#0.0 THEN
y_cut=-co_d/co_b
ELSE
y_cut=0
ENDIF

IF co_c#0.0 THEN
z_cut=-co_d/co_c
ELSE
z_cut=0
ENDIF


!-----DRAW OBJECT WITH CUTPLANE-----
if x_cut and y_cut and z_cut THEN CUTPLANE x_cut, y_cut, z_cut, 0

PRISM_ 9, 5.0,
0.0, 0.0, 15,
len, 0.0, 15,
len, dep, 15,
0.0, dep, 15,
0.0, dep-wall_thk, 15,
len-wall_thk, dep-wall_thk, 15,
len-wall_thk, wall_thk, 15,
0.0, wall_thk, 15,
0.0, 0.0, -1

if x_cut and y_cut and z_cut THEN CUTEND


!-----DRAW SPANING PLANE-----

MATERIAL "Glas"
PLANE 3,
 x1,y1,z1,
 x2,y2,z2,
 x3,y3,z3

!-----RECALCULATE POINTS IN PLANE-----

PRINT "If all Points are on the Plane, represented by the equation, all following results sould be zero."
PRINT "POINT 1: ",co_a*x1+co_b*y1+co_c*z1+co_d
PRINT "POINT 2: ",co_a*x2+co_b*y2+co_c*z2+co_d
PRINT "POINT 3: ",co_a*x3+co_b*y3+co_c*z3+co_d
PRINT "The constants a/b/c/d: ",co_a,"/",co_b,"/",co_c,"/",co_d
END
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Frank Beister
Advisor
You could proof, if one of the ordinates is zero and could calculate one other point on plane by inserting anything as x and y in the equation. Then repeat the ordinate calculation (-> make ab sub for it).
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Danny Sparks-Cousins
Contributor
Thanks for the help and the response. I have built in the parallel axis checking and it works exactly how I require.

Danny