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.
In 2021.01 OpenSCAD added the ability to read from stdin and write
output to stdout: this allows us to communicate with an OpenSCAD process
that does not have read/write access to the same directories that
FreeCAD does (for example, if one or the other is installed via a Snap
package).
This commit adds an additional preference to the OpenSCAD workbench
allowing the user to choose between communication methods, as well as to
optionally specify their own temporary directory for the data transfer,
for use in cases where their version of OpenSCAD is installed via Snap,
etc., but does not yet support the piped input and output.
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
* [OpenSCAD] Fixes cut color while importing CSG
Fixes#4684.
For some reason colors of "base" and "tool" need to be set in order for the cut
to have colors as well, just like fuse and multifuse.
Also tidied up the relevant code portions a little.
Some testing might be needed.
* [OpenSCAD] Color settings for other booleans in importCSG
As per Keith's comments, this change extends recursive color setting to other
boolean features viz. `Part::Common` and `Part::MultiCommon`. Also possible to
add any other features needing the same treatment.
* Update importCSG.py
Remove unneeded parentheses and fix its/it's mixup
Co-authored-by: Kurt Kremitzki <kkremitzki@users.noreply.github.com>
OCCT 7.3 did not work well when using a very large projection plane, so
this commit reduces the plane size to the minimum required for the cut
operation. It also performs some minor refactoring in anticipation of
the implementation of the true projection feature, and it removes the
last attempted fix, which proved unnecessary.
Address a hang when using older versions of OCC to create a rotated
extrusion. This approximates the auxilliary spine as set of line
segments formed from the helix, rather than using the helix directly.
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.
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.
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.
The existing implementation of resize() did not work, and used incorrect
scale factors. This commit implements a version that matches the results
obtained from within OpenSCAD.
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.