Commit Graph

258 Commits

Author SHA1 Message Date
Chris Hennes
ef60a73cb5 [OpenSCAD] Fix regression with angle specification
Correct mistake introduced in 0e66abcab.
2021-04-21 14:20:10 +02:00
Chris Hennes
2751398ec0 [OpenSCAD] Fix twist angle to not limit to 360 deg 2021-04-09 12:09:24 -05:00
Chris Hennes
08b7d9d0f3 [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
9540cf0bbd [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
46b0043b49 [OpenSCAD] Add additional recompute() logic 2021-03-29 13:58:52 -05:00
wmayer
bc51f50720 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
5b9f7116ce [OpenSCAD] Add angle & $fn to rotate_extrude(file) 2021-03-28 12:38:31 +02: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
wmayer
cd458165c3 OpenSCAD: [skip ci] pipeshell -> pipe_shell 2021-03-25 21:45:03 +01: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
8b8f2373d1 [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
9213565b3f [OpenSCAD] Minor fixes from LGTM analysis 2021-03-09 15:58:07 +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
helaslo
71fe41988b [OpenSCAD] Fix colors not working correctly when polygons are extruded 2021-02-25 15:08:19 +01:00
Yorik van Havre
5c12afb5b5 Merged crowdin translations 2021-02-24 18:07:59 +01:00
Yorik van Havre
0de8cceb53 Updated ts files 2021-02-12 14:47:37 +01:00
bitacovir
78bc6e6ad8 [UI] Replacement of 3 SVG icons for OpenSCAD commands 2021-02-11 12:07:09 +01:00
Chris Hennes
6b16e12d7c [OTHER] Catch only Exception, not BaseException 2021-02-11 11:52:45 +01:00
Yorik van Havre
97379e035a merged crowdin translations 2021-02-09 16:12:18 +01:00
Chris Hennes
cbceb87d95 Fix DXF import with no layers
As discussed in https://forum.freecadweb.org/viewtopic.php?f=3&t=54842, if OpenSCAD creates a DXF with no layers in it, the code that is supposed to handle that in FreeCAD has a minor type error in it that prevents the import from working.
2021-01-29 17:01:22 -06:00
bitacovir
c455fd9ec0 [UI] Replace of 2 SVG icons for OpenSCAD commands 2021-01-17 22:00:57 -03:00
fxjaeckel
8ba0b22e42 Update tokrules.py
[OpenSCAD] fix parser error for numbers with positive exponent >= 6
see forum: https://forum.freecadweb.org/viewtopic.php?f=3&t=54044
2021-01-05 20:26:42 -06:00
Yorik van Havre
22f7d5f3bc Merged crowdin translations 2020-12-23 15:13:05 +01:00
Yorik van Havre
ae2c707892 Merged crowdin translations 2020-11-10 14:58:06 +01:00
Yorik van Havre
43596a68af Merged crowdin translations 2020-10-28 12:04:37 +01:00
sgrogan
a8ca6ada87 fix import, OpenSCAD isn't namespace workbench 2020-10-17 23:54:26 +02:00
Yorik van Havre
c2cec2c38a Merged crowdin translations 2020-09-30 14:37:02 +02:00
Yorik van Havre
545055f65f Updated ts files 2020-09-30 13:06:53 +02:00
wmayer
6f196dc827 OpenSCAD: [skip ci] Coverity: Bad use of null-like value 2020-09-22 14:22:10 +02:00
hrobeers
7f36e21d4b [OpenSCAD] consistent FreeCADGui imports, fixes headless CSG import 2020-09-14 13:28:40 +02:00
luz paz
f0d823eb51 Crowdin: Merge new translations [skip-ci] 2020-08-07 17:17:35 +02:00
mwganson
d6530a0628 [OpenSCAD] Add 2 new commands: Scale and Resize, fix bug in Mirror mesh feature 2020-08-06 12:34:16 +02:00
wmayer
cca0c2737f OpenSCAD: [skip ci] set default of 16 for useMaxFN parameter 2020-08-06 09:47:25 +02:00
wmayer
c140ad0bb9 OpenSCAD: [skip ci] set default of 16 for useMaxFN parameter 2020-08-06 08:48:53 +02:00
mwganson
e6aee6b5e6 [openscad] mirror mesh feature -- rename OpenSCADUtils.mirror() to OpenSCADUtils.mirrormesh(), and provide some better interactive help information when typing OpenSCADUtils.mirrormesh() into the python console 2020-07-20 14:24:29 +02:00
mwganson
6c85779ec4 [openscad] mirror mesh feature -- separate gui from function 2020-07-20 14:24:29 +02:00
mwganson
ee7b4054ce [openscad] fix refine shape feature 2020-07-20 14:24:29 +02:00
mwganson
89ff7e16e2 [openscad] add updated icon to qrc file 2020-07-20 14:24:29 +02:00
mwganson
342fc03ce2 [openscad] work on icon for mesh mirror 2020-07-20 14:24:29 +02:00
mwganson
f429b568bb [openscad] add icon for mirror mesh feature 2020-07-20 14:24:29 +02:00
mwganson
c845ece1e3 [openscad] add ulrich's mirror mesh macro, fix error in refine shape 2020-07-20 14:24:29 +02:00
luz paz
e4f6689e0a Merged crowdin translations 2020-07-13 14:49:45 +02:00