Small face fails
-
stv=pts[0].vector_to(pts[2]).parallel? pts[0].vector_to(pts[3]) if stv==false face = entities.add_face pts[0], pts[2], pts[3] end
I have these 3 points:
-7.628099 15.463042 39.735762
-7.627601 15.463536 39.735292
-7.634701 15.538607 39.416031
if I use before the transformation with Ratio=39.37007874 the face works
but if I don't use Ratio transform on the points, or I use Ratio=1, the face fails
NOTE: the smallest edge of this face is long 0.0008, if I use Ratio=2 it becomes 0.0016, and in this case the face works. The "parallel?" works ever with these small points, but face does not. Strange. What's wrong?
Thanks in advance! -
Sketchup's internal accuracy is only 0.001 inch for geometry.
-
@dan rathbun said:
Sketchup's internal accuracy is only 0.001 inch for geometry.
thanks Dan, I think this means that in my parser is probably best to turn all points in a single array and turn on my scale before launching the drawing operations for all the faces....
-
You may be able to use a PolygonMesh instead of adding each Face. The mesh will also be faster to create than individual faces; but which is better depends on your goal.
See also:
http://code.google.com/apis/sketchup/docs/ourdoc/entities.html#add_faces_from_mesh
http://code.google.com/apis/sketchup/docs/ourdoc/entities.html#fill_from_mesh -
@jim said:
You may be able to use a PolygonMesh instead of adding each Face. The mesh will also be faster to create than individual faces; but which is better depends on your goal.
See also:
http://code.google.com/apis/sketchup/docs/ourdoc/entities.html#add_faces_from_mesh
http://code.google.com/apis/sketchup/docs/ourdoc/entities.html#fill_from_meshYes I thank you, but I am working about some interfaces between SketchUp and other CAD system. At this moment I am unable to find the unique criterion that SkUp uses to dispense the order of the ponts in the mesh. Especially about faces edited by subtraction of other faces or with holes.
The mesh is really difficult to decode because the vertexes seem to hop and to return using a lot of different combinations. This is really laborious and so I use to split triangular faces, that in CAD is a 4 vertexs faces with a duplicated vertex, or, where it'i possible, a couple of SkUp triangles that are a unique (cad) 3DFACE.
Anyway I thank you very much, because I'll to import also textures, and I will need of the meshes also, I fear...
Excuse my bad english..
Advertisement