Creating the parsetab.py cache file in a system wide fixed location
(e.g. /tmp/parsetab.py) creates problems when a computer is used by
different users. Also the file is never removed, which is not very nice.
Caching provides hardly any benefit here, as it only takes milliseconds,
and may even be negated by the additional required filesystem operations.
Fixes (part of) #6315.
The original algorithm tried to use a heuristic to calculate which
objects should be shown or hidden, based on the object name. This commit
replaces that heurstic with a request for the list of root objects from
FreeCAD, which is then filtered to remove those that existed before the
import. Any descendant of those root objects is hidden, and the root
made visible, in keeping with the design of the CSG importer.
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>