PolyFace2PolyMesh
-
Anyone can help me understand the algorithm to take the dxf of a polyface (abbreviated description of a mesh to save space in the database. Illustrated below as a polyline):
, and turn it in to this mesh:
The original polyface dxf is a collection of polyline vertex (illustration 1). I need help with the algorithm to read my_points(illustration 1) into my_new_pointsfor the following method taken from the api:
` my_face = Sketchup.active_model.entities.add_face my_new_points
my_mesh = my_face.meshCreate a new group that we will populate with the mesh.
group = Sketchup.active_model.entities.add_group
f_material = Sketchup.active_model.materials[0]
f_material.color = "green"
group.add_faces_from_mesh my_mesh, 0, f_material`
-
@honoluludesktop said:
[ruby:9hkapi4s]my_face = Sketchup.active_model.entities.add_face my_new_points
my_mesh = my_face.meshThis part won't work.
add_face
require coplanar points and creates a flat face.You need to create the mesh from skratch:
PolygonMesh.new
I just quickly scanned that doc - but from I gather a mesh is a rectangular mesh?
-
Hmm......, appears you are right. Maybe I have the wrong algorithm? Well, I guess PolyFace2MeshPolygonMesh will remain unimplemented in my translator.
-
The algorythm in your posted .doc file looks sound - it's just that you need to create a PolygonMesh from scratch - not via a Face.
Advertisement