【问题标题】:3D coordinates in ASCII stereolithography files (STLA)ASCII 立体光刻文件 (STLA) 中的 3D 坐标
【发布时间】:2011-03-17 03:27:22
【问题描述】:

我阅读了STLA Files (ASCII stereolithography files) 的简短描述,但很抱歉,我不明白如何定义小平面/三角形。

以立方体为例:

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 坐标是多少?

谢谢

【问题讨论】:

    标签: 3d file-format 3d-modelling


    【解决方案1】:

    法线定义了面部指向的方向。

    您可以根据构成刻面的三个点来计算它。选择一个作为原点,然后取 OA 和 OB 的叉积(其中 A 和 B 是另外两个顶点)。然而,你得到的法线取决于你选择哪个顶点作为原点以及你做叉积的顺序。如果您定义了法线,则可以确定顶点的正确“缠绕顺序”。

    立方体的 8 个顶点将是所有面的 8 个唯一顶点。

    但是,这个实体并不代表立方体,因为只有 4 个三角形,其中两条法线相同,一条法线与其他法线不成直角。

    【讨论】:

      猜你喜欢
      • 2014-12-22
      • 1970-01-01
      • 2014-04-29
      • 1970-01-01
      • 2021-01-10
      • 2016-10-09
      • 1970-01-01
      • 1970-01-01
      • 2021-03-26
      相关资源
      最近更新 更多