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.