ASCII 立体光刻文件 (STLA) 中的 3D 坐标
我阅读了 STLA 文件(ASCII 立体光刻文件)的简短描述< /a> 但是,抱歉,我不明白面/三角形是如何定义的。
例如,在立方体的示例中:
solid cube_corner
facet normal 0.0 -1.0 0.0
outer loop
vertex 0.0 0.0 0.0
vertex 1.0 0.0 0.0
vertex 0.0 0.0 1.0
endloop
endfacet
facet normal 0.0 0.0 -1.0
outer loop
vertex 0.0 0.0 0.0
vertex 0.0 1.0 0.0
vertex 1.0 0.0 0.0
endloop
endfacet
facet normal 0.0 0.0 -1.0
outer loop
vertex 0.0 0.0 0.0
vertex 0.0 0.0 1.0
vertex 0.0 1.0 0.0
endloop
endfacet
facet normal 0.577 0.577 0.577
outer loop
vertex 1.0 0.0 0.0
vertex 0.0 1.0 0.0
vertex 0.0 0.0 1.0
endloop
endfacet
endsolid
第一个“面”描述了一个 3D 三角形,不是吗? (0,0,0),(1,0,0),(0,0,1)。那么法向量 (0,-1,0) 有什么用呢?在此示例中,该立方体 8 个顶点的 3D 坐标是多少?
谢谢
I read the short description of the STLA Files (ASCII stereolithography files) but , Im sorry, I don't get how the facets/triangles are defined.
For Example in the example for the cube:
solid cube_corner
facet normal 0.0 -1.0 0.0
outer loop
vertex 0.0 0.0 0.0
vertex 1.0 0.0 0.0
vertex 0.0 0.0 1.0
endloop
endfacet
facet normal 0.0 0.0 -1.0
outer loop
vertex 0.0 0.0 0.0
vertex 0.0 1.0 0.0
vertex 1.0 0.0 0.0
endloop
endfacet
facet normal 0.0 0.0 -1.0
outer loop
vertex 0.0 0.0 0.0
vertex 0.0 0.0 1.0
vertex 0.0 1.0 0.0
endloop
endfacet
facet normal 0.577 0.577 0.577
outer loop
vertex 1.0 0.0 0.0
vertex 0.0 1.0 0.0
vertex 0.0 0.0 1.0
endloop
endfacet
endsolid
The first 'facet' describes a 3D triangle isn't it ? (0,0,0),(1,0,0),(0,0,1). Then what is the use the normal vector (0,-1,0) ? In this example, what would be the 3D coordinates of the 8 vertexes for this cube ?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
法线定义了面指向的方向。
您可以根据构成该面的三个点来计算它。选择一个作为原点,然后取 OA 和 OB 的叉积(其中 A 和 B 是另外两个顶点)。然而,您获得的法线将取决于您选择的顶点作为原点以及进行叉积的顺序。如果定义了法线,则可以确定顶点的正确“缠绕顺序”。
立方体的 8 个顶点将是所有面的 8 个唯一顶点。
然而,这个实体并不代表立方体,因为它只有 4 个三角形,其中两个法线相同,并且一个与其他法线不成直角。
The normal defines which way the face points.
You can calculate it from the three points that make up the facet. Choose one as the origin and then take the cross product of OA and OB (where A and B are the other two vertices). However the normal you get will depend on which vertex you pick as the origin and the order you do the cross product. If you have the normal defined you can determine the correct "winding order" of the vertices.
The 8 vertices of the cube will be the 8 unique vertices across all the facets.
However, this solid doesn't represent a cube as there are only 4 triangles, two of the normals are the same and one isn't at right angles to the others.