Skip to content

Commit

Permalink
Add 'vertex' in front of each vertex vectors in STL export (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
mortenbekditlevsen authored and nicklockwood committed Aug 11, 2023
1 parent 5f8426e commit 0f82eb0
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion Sources/Mesh+STL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ private extension Polygon {
facet normal \(plane.normal.stlString)
\touter loop
\(vertices.map {
"\t\t\($0.position.stlString)"
"\t\tvertex \($0.position.stlString)"
}.joined(separator: "\n"))
\tendloop
endfacet
Expand Down
72 changes: 36 additions & 36 deletions Tests/MeshTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -338,86 +338,86 @@ class MeshTests: XCTestCase {
solid Foo
facet normal 1 0 0
\touter loop
\t\t1 0 1
\t\t1 0 0
\t\t1 1 0
\t\tvertex 1 0 1
\t\tvertex 1 0 0
\t\tvertex 1 1 0
\tendloop
endfacet
facet normal 1 0 0
\touter loop
\t\t1 0 1
\t\t1 1 0
\t\t1 1 1
\t\tvertex 1 0 1
\t\tvertex 1 1 0
\t\tvertex 1 1 1
\tendloop
endfacet
facet normal -1 0 0
\touter loop
\t\t0 0 0
\t\t0 0 1
\t\t0 1 1
\t\tvertex 0 0 0
\t\tvertex 0 0 1
\t\tvertex 0 1 1
\tendloop
endfacet
facet normal -1 0 0
\touter loop
\t\t0 0 0
\t\t0 1 1
\t\t0 1 0
\t\tvertex 0 0 0
\t\tvertex 0 1 1
\t\tvertex 0 1 0
\tendloop
endfacet
facet normal 0 1 0
\touter loop
\t\t0 1 1
\t\t1 1 1
\t\t1 1 0
\t\tvertex 0 1 1
\t\tvertex 1 1 1
\t\tvertex 1 1 0
\tendloop
endfacet
facet normal 0 1 0
\touter loop
\t\t0 1 1
\t\t1 1 0
\t\t0 1 0
\t\tvertex 0 1 1
\t\tvertex 1 1 0
\t\tvertex 0 1 0
\tendloop
endfacet
facet normal 0 -1 0
\touter loop
\t\t0 0 0
\t\t1 0 0
\t\t1 0 1
\t\tvertex 0 0 0
\t\tvertex 1 0 0
\t\tvertex 1 0 1
\tendloop
endfacet
facet normal 0 -1 0
\touter loop
\t\t0 0 0
\t\t1 0 1
\t\t0 0 1
\t\tvertex 0 0 0
\t\tvertex 1 0 1
\t\tvertex 0 0 1
\tendloop
endfacet
facet normal 0 0 1
\touter loop
\t\t0 0 1
\t\t1 0 1
\t\t1 1 1
\t\tvertex 0 0 1
\t\tvertex 1 0 1
\t\tvertex 1 1 1
\tendloop
endfacet
facet normal 0 0 1
\touter loop
\t\t0 0 1
\t\t1 1 1
\t\t0 1 1
\t\tvertex 0 0 1
\t\tvertex 1 1 1
\t\tvertex 0 1 1
\tendloop
endfacet
facet normal 0 0 -1
\touter loop
\t\t1 0 0
\t\t0 0 0
\t\t0 1 0
\t\tvertex 1 0 0
\t\tvertex 0 0 0
\t\tvertex 0 1 0
\tendloop
endfacet
facet normal 0 0 -1
\touter loop
\t\t1 0 0
\t\t0 1 0
\t\t1 1 0
\t\tvertex 1 0 0
\t\tvertex 0 1 0
\t\tvertex 1 1 0
\tendloop
endfacet
endsolid Foo
Expand Down

0 comments on commit 0f82eb0

Please sign in to comment.