Skip to content

Commit 38f8de3

Browse files
authored
Merge pull request #18 from nomike:Fix-positioning-in-OpenSCAD-templates
Fix wrong positioning in openscad templates.
2 parents f7a2c37 + e16c07e commit 38f8de3

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

src/stldim/templates/openscad_lib.jinja2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ module {{mesh.varname }}_obj2origin (where) {
4242
}
4343

4444
module {{mesh.varname }}_objNE () {
45-
translate([ {{ mesh.minx }},{{ mesh.miny }},{{ mesh.minz }}])
45+
translate([{{ - mesh.minx }}, {{ - mesh.miny }}, {{ - mesh.minz }}])
4646
import("{{ mesh.filename }}");
4747
}

src/stldim/templates/openscad_lib_basename.jinja2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ module {{mesh.varname }}_obj2origin (where) {
4242
}
4343

4444
module {{mesh.varname }}_objNE () {
45-
translate([ {{ mesh.minx }},{{ mesh.miny }},{{ mesh.minz }}])
45+
translate([{{ - mesh.minx }}, {{ - mesh.miny }}, {{ - mesh.minz }}])
4646
import("{{ os.path.basename(mesh.filename) }}");
4747
}

src/stldim/tests/test_mesh_with_bounds.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,11 @@ def test_render_openscad_lib():
172172
}
173173
174174
module test_stl_objNE () {
175-
translate([ 0.0,0.0,0.0])
175+
translate([-0.0, -0.0, -0.0])
176176
import("tests/test.stl");
177177
}"""
178178

179+
179180
def test_render_openscad_lib_basename():
180181
"""
181182
Test rendering the openscad_lib template
@@ -229,6 +230,6 @@ def test_render_openscad_lib_basename():
229230
}
230231
231232
module test_stl_objNE () {
232-
translate([ 0.0,0.0,0.0])
233+
translate([-0.0, -0.0, -0.0])
233234
import("test.stl");
234235
}"""

src/stldim/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
__email__ = "[email protected]"
88
__license__ = "MIT"
99
__title__ = "stldim"
10-
__version__ = "0.4.1"
10+
__version__ = "0.4.2"
1111

1212
__str__ = f'{__title__} v{__version__} by {__author__} <{__email__}>'

0 commit comments

Comments
 (0)