Automate creating of triangles on mesh with ruby



can you please write a ruby code for me, which would automate the job I need to do?

To find squares/rectangles in selected mesh, which has length of edges at least 1m and maximum 5m. The edges must be part of the same plane… And its front face must contain material “crater small” or “crater medium”.

When this square is found, add 2 diagonal lines from one corner to another, add 2 middle lines from edge middle to opposite edge middle (see image).

And then,
if the (side) edge is cca 1-1,5m then drag the middle (intersection) down y=-20cm else
if the (side) edge is cca 2.3-2,6m then drag the middle (intersection) down y=-50cm else
if the (side) edge is cca 4.9-5.2m then
if material=="crater medium"
drag the middle (intersection) down y=-120cm.
drag the middle (intersection) down y=-80cm
craters.skp (1.3 MB)


This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.