I have created a mesh from points I created in c++. I send the array to Ruby via test5. It creates the geometry I am looking for but the faces are not filled. I have tried both fill from mesh and add faces from mesh.
# Gets the array of vertices from C++
vertArr = SUEX_test5.test5
myMesh = Geom::PolygonMesh.new
vertPointArr = Array.new
# Loop through the array and add the points to the new mesh
# Create an array of the points to use in creating a polygon from the mesh
vertArr.each do |point|
newPoint = Geom::Point3d.new (point)
#UI.messagebox(newPoint)
myMesh.add_point(newPoint)
vertPointArr.push(newPoint)
end
#new_face = entities.add_face facePointArr
# Use the array of points to create polygon
myMesh.add_polygon vertPointArr
group = Sketchup.active_model.entities.add_group
material = Sketchup.active_model.materials.add('red')
smooth_flags = Geom::PolygonMesh::HIDE_BASED_ON_INDEX
#group.entities.add_faces_from_mesh(myMesh, smooth_flags, material)
group.entities.fill_from_mesh(myMesh, true, smooth_flags, material)