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_facerequire coplanar points and creates a flat face.You need to create the mesh from skratch:
PolygonMesh.newI 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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement