Commit Graph

285 Commits

Author SHA1 Message Date
luz paz
bb108cff95 Fix user facing typos [skip ci]
Typos in Draft and OpenSCAD code.
2021-10-06 18:11:48 -04:00
Chris Hennes
eb9f47048a Merge pull request #5075 from chennes/openSCADSandboxingFix
[OpenSCAD] Add ability to communicate over stdin/stdout (to support Snaps, etc.)
2021-09-29 14:29:57 -05:00
Chris Hennes
62bd69e53d [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
2e504ab3b6 [OpenSCAD] Add ability to communicate via pipes
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.
2021-09-29 09:36:58 -05:00
Yorik van Havre
77925c428e Updated ts files 2021-09-29 14:32:12 +02:00
Yorik van Havre
b042405933 Merged crowdin translations 2021-09-23 17:14:48 +02:00
Yorik van Havre
89e1a97d80 Merged crowdin translations 2021-09-07 11:26:48 +02:00
Yorik van Havre
49abe81271 Merged crowdin translations 2021-08-26 14:51:36 +02:00
Yorik van Havre
a8cb3ef1e3 Updated ts files 2021-08-26 14:50:54 +02:00
Chris Hennes
a80e67c04c [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
Ajinkya Dahale
2343c3cbe2 [OpenSCAD] Fixes cut color while importing CSG (#4920)
* [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>
2021-08-14 15:04:02 -05:00
Yorik van Havre
1cee70cd62 Merged crowdin translations 2021-07-08 16:06:38 +02:00
Yorik van Havre
ed9dca288c Merged crowdin translations 2021-07-01 13:56:25 +02:00
Yorik van Havre
c8b5d8d762 Merged crowdin translations 2021-06-24 17:22:19 +02:00
Yorik van Havre
69b084f492 Merged crowdin translations 2021-06-17 16:04:02 +02:00
Yorik van Havre
d0d637b2c6 merged crowdin translations 2021-06-03 15:43:34 +02:00
Yorik van Havre
4361893f24 updated ts files 2021-06-03 15:37:33 +02:00
Yorik van Havre
ff6845e2f3 OpenSCAD: Fixed typo 2021-05-31 14:54:48 +02:00
Yorik van Havre
b1d9a5607f Merged crowdin translations 2021-05-27 14:51:33 +02:00
Yorik van Havre
c6771853ae Updated translation files 2021-05-27 14:44:40 +02:00
Chris Hennes
99f9c3405c [OpenSCAD] Fix missing hide() on linear extrude 2021-05-13 10:27:49 -05:00
Yorik van Havre
7b0a6358b1 Merged crwodin translations 2021-05-12 16:36:31 +02:00
Yorik van Havre
81a44fcccb Updated ts files 2021-05-11 13:05:20 +02:00
Yorik van Havre
131cdd1e4e Merge pull request #4557 from luzpaz/crowdin/whitespaces-substituted-into-code
Crowdin: represent whitespace in code instead of in string
2021-05-05 17:18:35 +02:00
Keith Sloan
d850ed87aa Add Load/Save/Refresh to add OpenSCAD Elements 2021-04-27 17:42:06 +01:00
Keith Sloan
8bdf4a7a2b Add load/save/refresh to addElement 2021-04-25 15:10:46 +01:00
Chris Hennes
f3e9f6c4cd [OpenSCAD] Fix regression with angle specification
Correct mistake introduced in 7eec10def.
2021-04-21 14:20:10 +02:00
luz paz
f2b93a7af3 Crowdin: represent whitespace in code instead of in string [skip ci]
Removing possible whitespace from strings lead to more accurate translations
2021-04-19 06:16:09 -04:00
Chris Hennes
602fef267a [OpenSCAD] Fix twist angle to not limit to 360 deg 2021-04-09 12:09:24 -05:00
Chris Hennes
663ac994a7 [OpenSCAD] Fix projection for OCCT7.3
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.
2021-03-30 22:55:16 +02:00
Chris Hennes
fbd6b0441f [OpenSCAD] Add piecewise helix for OCCT < 7.5
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.
2021-03-29 13:59:03 -05:00
Chris Hennes
b18cabae05 [OpenSCAD] Add additional recompute() logic 2021-03-29 13:58:52 -05:00
wmayer
4fbdcfb477 OpenSCAD: [skip ci] disable rich text in OpenSCAD widget to avoid weird behaviour when copying code from an HTML page 2021-03-28 13:51:38 +02:00
Chris Hennes
dfd683d464 [OpenSCAD] Add angle & $fn to rotate_extrude(file) 2021-03-28 12:38:31 +02:00
Chris Hennes
4e58747c16 [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
wmayer
2490629a4a OpenSCAD: [skip ci] pipeshell -> pipe_shell 2021-03-25 21:45:03 +01:00
Chris Hennes
8cbfa5a717 [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
69f24859b5 [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
371b089ea0 OpenSCAD: fix test_import_surface by changing currently working directory 2021-03-17 12:35:15 +01:00
wmayer
9a105e3405 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
0581409fbe OpenSCAD: [skip ci] fix incorrect filename creation in unit tests 2021-03-17 11:56:58 +01:00
Chris Hennes
6bf27e0ae1 [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
bfce108083 [OpenSCAD] Add scale parameter to linear_extrude 2021-03-11 13:56:26 +01:00
Chris Hennes
a00c00e4da [OpenSCAD] Add unit tests for resize() and others 2021-03-10 15:33:45 +01:00
Chris Hennes
a02f6b4b91 [OpenSCAD] Implement resize()
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.
2021-03-10 15:33:45 +01:00
Chris Hennes
7b33ba361b [OpenSCAD] Minor fixes from LGTM analysis 2021-03-09 15:58:07 +01:00
Chris Hennes
b2ebaa01a2 [OpenSCAD] Add unit tests for importing primitives 2021-03-06 13:31:09 +01:00
Chris Hennes
c1408f130c [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
helaslo
d29fd7d9cb [OpenSCAD] Fix colors not working correctly when polygons are extruded 2021-02-25 15:08:19 +01:00
Yorik van Havre
5ba28fa7ff Merged crowdin translations 2021-02-24 18:07:59 +01:00