Notifications
Clear all

[Closed] Detecting faces that are pointing up

What kind of calculus should you perform to select the faces of a geometry (say a cube) whose normals are pointing in a specific direction (say z axis)?

4 Replies
(
   	axis = [0,0,1]
   	
   	for j = 1 to $.numfaces do
   	(
   		normal = polyop.getfacenormal $ j
   		format "face:% dot:%
" j (dot normal axis)
   	)
   )

1 = face parallel to the axis.
-1 = face parallel to the axis in opposite direction.
0 = face perpendicular to the axis
>0 = face pointing in the axis direction (angle >0 and <90 degrees)
<0 = face pointing opposite to the axis

Awesome, I didn’t know that dot product could do such things. Thanks.

dot product can’t do anything else

You can reach the graphite modelling tools too…

<bool>PolyToolsSelect.Normal <integer>axis <float>value <bool>invert