Commit Graph

16 Commits

Author SHA1 Message Date
luz paz
b3ce571ad7 OpenSCAD: pep8-ified + removed superfluous whitespace + uniform headers 2022-01-23 19:52:37 -06:00
Chris Hennes
ba6fb8fb8e OpenSCAD: Handle missing script element from text() 2021-12-18 16:23:31 -06:00
Chris Hennes
81830d850f OpenSCAD: Refactor tests to all use the same code path for tempdir generation 2021-11-07 17:13:51 -06:00
Chris Hennes
0bf885145f [OpenSCAD] Update STL unit test to warn on pipes
If OpenSCAD or FreeCAD is set up to use pipes for communication, assume
it's because one or the other is sandboxed. In that case, OpenSCAD will
not be able to import the generated STL file from FreeCAD, so don't try
to run that test.
2021-09-29 10:24:11 -05:00
Chris Hennes
274544d868 [OpenSCAD] Fix OpenSCAD bounding box calculations
When not using the GUI, bounding box calculations can sometimes use the
B-spline represenation in OCCT, which can in some cases give incorrect
results. To correct for this, explicit calls to tessellate() are added
to ensure that the bounding box calculation uses the true shape, even if
the GUI is not running.

Fixes #4622 - OpenSCAD/OpenSCADTest/app/test_importCSG.py assertion failure
2021-08-17 11:09:55 -05:00
Chris Hennes
74c2ef4e8d [OpenSCAD] Add $fn and angle to rotate_extrude()
As pointed out in Issue #0004353 the OpenSCAD Workbench does not
correctly implement the angle parameter to rotate_extrude (it's a
relatively recent addition to OpenSCAD), nor does it attempt to do
anything with a specified $fn. This commit adds both features. To add
$fn handling, the code from the cylinder extrusion was mimicked,
allowing FreeCAD to create perfect, smooth representations when $fn
exceeds a user specified value in Preferences, but attempting to create
OpenSCAD's more discrete representation when using a lower $fn. Note
that this determination is made at creation time: if the user later
increases the segments parameter in the new object, it will remain
prismatic regardless of how high the value is made.
2021-03-28 12:38:11 +02:00
Chris Hennes
57c93cd6b3 [OpenSCAD] Improve helical extrusion, fix scaling
Modify the auxiliary spine to be a true helix, resulting in a much
smoother linear extrusion when a twist angle is applied. This also
corrects a bug in the scaling during linear extrusion, where non-uniform
scaling was not handled correctly.
2021-03-25 21:23:29 +01:00
Chris Hennes
a0464d1b00 [OpenSCAD] Fix bug in resize code
The resize code must recompute some kinds of objects prior to requesting
their bounding box, or the bounding box can be invalid.
2021-03-25 21:20:47 +01:00
wmayer
fc39b205d2 OpenSCAD: fix test_import_surface by changing currently working directory 2021-03-17 12:35:15 +01:00
wmayer
a1952dade7 OpenSCAD: fix utility_create_scad by changing currently working directory so that test_import_surface doesn't fail any more 2021-03-17 11:59:14 +01:00
wmayer
a9b602816d OpenSCAD: [skip ci] fix incorrect filename creation in unit tests 2021-03-17 11:56:58 +01:00
Chris Hennes
748e113418 [OpenSCAD] Reimplement surface() to match OpenSCAD
The original implementation of the surface() function used a simple
B-spline representation for the surface, which generated degenerate
surface with several of OpenSCAD's demo input files. This commit
modifies the algorithm to generate a discrete surface identical to the
one generated within OpenSCAD itself. It also adds several units tests
to identify future regressions.

Note that PNG input is not yet supported for the surface() function.
2021-03-13 16:11:16 +01:00
Chris Hennes
0a0d939522 [OpenSCAD] Add scale parameter to linear_extrude 2021-03-11 13:56:26 +01:00
Chris Hennes
5dbeb210e0 [OpenSCAD] Add unit tests for resize() and others 2021-03-10 15:33:45 +01:00
Chris Hennes
73dd71dadc [OpenSCAD] Add unit tests for importing primitives 2021-03-06 13:31:09 +01:00
Chris Hennes
3e48fef002 [OpenSCAD] Add unit test framework to module
The OpenSCAD module did not have any unit tests. This commit adds the
basic framework (and two very simple tests). The framework is modeled
after the unit tests in the FEM module.
2021-03-01 15:21:18 +01:00