Notifications
Clear all
[Closed] Break Non Planar Polygons into Triangulated Polygons
Page 2 / 2
Prev
Jan 16, 2013 5:38 pm
unfixed author’s bugs sometimes help others to understand how the code works
that’s the main difference between bugs and errors.
Jan 18, 2013 3:13 pm
here is it:
fn hasNonPlanarFaces node threshold:0.0001 = if iskindof node GeometryClass do
(
mesh = snapshotasmesh node
done = #{}
has = off
for f=1 to mesh.numfaces while not has where not done[f] do
(
ff = meshop.getPolysUsingFace mesh f
join done ff
if ff.numberset > 1 do
(
ff = ff as array
n = getfacenormal mesh ff[1]
for k=2 to ff.count while not has do
(
has = (abs (1.0 - (dot n (getfacenormal mesh ff[k]))) > threshold)
-- if has do format "%: % != %
" ff n (getfacenormal mesh ff[k])
)
)
)
free mesh
has
)
btw… i found in documentation:
meshop.getPolysUsingEdge <Mesh mesh> <edgelist> ignoreVisEdges:<boolean=false> threshhold:<float=45.>
Jan 18, 2013 3:13 pm
Thanks for the function… I’ll test it later today.
I did test with with meshop.getPolysUsingEdge but was failing… will look at it again.
Page 2 / 2
Prev