<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: CUTPLANE from Plane Normal in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/CUTPLANE-from-Plane-Normal/m-p/23104#M34112</link>
    <description>The x, y and z represent the break through points of the three axis on the curplane. If you have the plane equation&lt;BR /&gt;
&lt;BR /&gt;
ax + by+ cz + d = 0&lt;BR /&gt;
&lt;BR /&gt;
You can set y=0 and z=0 to get the point on the X axis. Similar for the both others.&lt;BR /&gt;
&lt;BR /&gt;
Maybe you will need a fourth parameter. If you add a "1" at the end, the cutting direction will be flipped.&lt;BR /&gt;
&lt;BR /&gt;
Can you maybe post the whole formula for the three points?</description>
    <pubDate>Thu, 06 Jul 2006 06:29:57 GMT</pubDate>
    <dc:creator>Frank Beister</dc:creator>
    <dc:date>2006-07-06T06:29:57Z</dc:date>
    <item>
      <title>CUTPLANE from Plane Normal</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/CUTPLANE-from-Plane-Normal/m-p/23103#M34111</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;Hi,&lt;BR /&gt;
&lt;BR /&gt;
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. &lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
Any help would be greatly appreciated.&lt;BR /&gt;
&lt;BR /&gt;
Kind Regards,&lt;BR /&gt;
Danny&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 06 Jul 2006 06:02:50 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/CUTPLANE-from-Plane-Normal/m-p/23103#M34111</guid>
      <dc:creator>Danny Sparks-Cousins</dc:creator>
      <dc:date>2006-07-06T06:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: CUTPLANE from Plane Normal</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/CUTPLANE-from-Plane-Normal/m-p/23104#M34112</link>
      <description>The x, y and z represent the break through points of the three axis on the curplane. If you have the plane equation&lt;BR /&gt;
&lt;BR /&gt;
ax + by+ cz + d = 0&lt;BR /&gt;
&lt;BR /&gt;
You can set y=0 and z=0 to get the point on the X axis. Similar for the both others.&lt;BR /&gt;
&lt;BR /&gt;
Maybe you will need a fourth parameter. If you add a "1" at the end, the cutting direction will be flipped.&lt;BR /&gt;
&lt;BR /&gt;
Can you maybe post the whole formula for the three points?</description>
      <pubDate>Thu, 06 Jul 2006 06:29:57 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/CUTPLANE-from-Plane-Normal/m-p/23104#M34112</guid>
      <dc:creator>Frank Beister</dc:creator>
      <dc:date>2006-07-06T06:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: CUTPLANE from Plane Normal</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/CUTPLANE-from-Plane-Normal/m-p/23105#M34113</link>
      <description>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. &lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
Thanks again for your help on this problem.&lt;BR /&gt;
&lt;BR /&gt;
Kind Regards,&lt;BR /&gt;
Danny&lt;BR /&gt;
&lt;BR /&gt;
!-----SET SIZES-----&lt;BR /&gt;
len=1.0&lt;BR /&gt;
dep=1.0&lt;BR /&gt;
wall_thk=0.090&lt;BR /&gt;
&lt;BR /&gt;
!-----SET POINTS-----&lt;BR /&gt;
x1=0.0 : y1=0.0 : z1=0.3&lt;BR /&gt;
x2=1.0 : y2=0.5 : z2=0.6&lt;BR /&gt;
x3=0.0 : y3=1.0 : z3=0.3&lt;BR /&gt;
&lt;BR /&gt;
!-----CALCULATE VALUES FOR PLANAR EQUATION-----&lt;BR /&gt;
co_a=(y1*(z2-z3))+(y2*(z3-z1))+(y3*(z1-z2))&lt;BR /&gt;
co_b=(z1*(x2-x3))+(z2*(x3-x1))+(z3*(x1-x2))&lt;BR /&gt;
co_c=(x1*(y2-y3))+(x2*(y3-y1))+(x3*(y1-y2))&lt;BR /&gt;
co_d=-((x1*((y2*z3)-(y3*z2)))+(x2*((y3*z1)-(y1*z3)))+(x3*((y1*z2)-(y2*z1))))&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
!-----CALCULATE POINTS FOR CUTPLANE-----&lt;BR /&gt;
IF co_a#0.0 THEN&lt;BR /&gt;
     x_cut=-co_d/co_a&lt;BR /&gt;
ELSE&lt;BR /&gt;
     x_cut=1.0&lt;BR /&gt;
ENDIF&lt;BR /&gt;
&lt;BR /&gt;
IF co_b#0.0 THEN&lt;BR /&gt;
     y_cut=-co_d/co_b&lt;BR /&gt;
ELSE&lt;BR /&gt;
     y_cut=1.0&lt;BR /&gt;
ENDIF&lt;BR /&gt;
&lt;BR /&gt;
IF co_c#0.0 THEN&lt;BR /&gt;
     z_cut=-co_d/co_c&lt;BR /&gt;
ELSE&lt;BR /&gt;
     z_cut=1.0&lt;BR /&gt;
ENDIF&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
!-----DRAW OBJECT WITH CUTPLANE-----&lt;BR /&gt;
CUTPLANE x_cut, y_cut, z_cut, 0&lt;BR /&gt;
&lt;BR /&gt;
PRISM_ 9, 5.0,&lt;BR /&gt;
     0.0, 			0.0, 			15,&lt;BR /&gt;
     len,			0.0,			15,&lt;BR /&gt;
     len,			dep,			15,&lt;BR /&gt;
     0.0,			dep,			15,&lt;BR /&gt;
     0.0, 			dep-wall_thk,	15,&lt;BR /&gt;
     len-wall_thk,	dep-wall_thk,	15,&lt;BR /&gt;
     len-wall_thk,	wall_thk,		15,&lt;BR /&gt;
     0.0,			wall_thk,		15,&lt;BR /&gt;
     0.0, 			0.0, 			-1&lt;BR /&gt;
&lt;BR /&gt;
CUTEND&lt;BR /&gt;
&lt;BR /&gt;
END</description>
      <pubDate>Thu, 06 Jul 2006 09:45:50 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/CUTPLANE-from-Plane-Normal/m-p/23105#M34113</guid>
      <dc:creator>Danny Sparks-Cousins</dc:creator>
      <dc:date>2006-07-06T09:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: CUTPLANE from Plane Normal</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/CUTPLANE-from-Plane-Normal/m-p/23106#M34114</link>
      <description>Done very well, but you trapped into one definition lack:&lt;BR /&gt;
The three ordinates may not be zero, because these special cases built up a cutplane parallel to one of the three axis.&lt;BR /&gt;
&lt;BR /&gt;
Try this (copy it to &lt;B&gt;MASTER&lt;/B&gt;script to get PRINT to work).&lt;BR /&gt;

&lt;PRE&gt;!-----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&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Jul 2006 10:12:07 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/CUTPLANE-from-Plane-Normal/m-p/23106#M34114</guid>
      <dc:creator>Frank Beister</dc:creator>
      <dc:date>2006-07-06T10:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: CUTPLANE from Plane Normal</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/CUTPLANE-from-Plane-Normal/m-p/23107#M34115</link>
      <description>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 (-&amp;gt; make ab sub for it).</description>
      <pubDate>Thu, 06 Jul 2006 10:17:00 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/CUTPLANE-from-Plane-Normal/m-p/23107#M34115</guid>
      <dc:creator>Frank Beister</dc:creator>
      <dc:date>2006-07-06T10:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: CUTPLANE from Plane Normal</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/CUTPLANE-from-Plane-Normal/m-p/23108#M34116</link>
      <description>Thanks for the help and the response. I have built in the parallel axis checking and it works exactly how I require.&lt;BR /&gt;
&lt;BR /&gt;
Danny</description>
      <pubDate>Thu, 06 Jul 2006 10:37:57 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/CUTPLANE-from-Plane-Normal/m-p/23108#M34116</guid>
      <dc:creator>Danny Sparks-Cousins</dc:creator>
      <dc:date>2006-07-06T10:37:57Z</dc:date>
    </item>
  </channel>
</rss>

