Commit Graph

103 Commits

Author SHA1 Message Date
Andrea
87ed2bb6dc Clean importCSG.py
Clean code
Update importCSG.py
2025-01-25 05:35:43 -06:00
hasecilu
66e81e866b TechDraw: Fix capitalization of 2D and 3D 2024-09-14 12:07:50 -06:00
Dov Grobgeld
e66e90b512 Fix run time errors with python3.12 and pyside6 (#13337)
* Change pyopen=open expression to from builtins import open as pyopen

---------

Co-authored-by: Adrián Insaurralde Avalos <36372335+adrianinsaval@users.noreply.github.com>
2024-04-30 00:28:01 -04:00
Nexusnui
b6b7bc876c Update importCSG.py
Fixed Scaling with one parameter
2024-04-29 17:46:10 +02:00
luzpaz
2e8f7817d9 OpenSCAD: linting importCSG.py 2023-04-02 12:19:02 +02:00
Chris Hennes
f9ed455922 OpenSCAD: Improve shape-checking in group action 2023-03-03 10:11:20 -06:00
Chris Hennes
ff6d9ccc76 OpenSCAD: Linter cleanup 2023-02-24 21:58:39 -06:00
Chris Hennes
f9344fd2de OpenSCAD: Remove old workaround code
Fixes #8621
2023-02-24 16:13:54 -06:00
Chris Hennes
e75d3eecaa OpenSCAD: Ensure complex fuse has no extra placement 2022-11-30 18:30:06 -06:00
Chris Hennes
8ccd6a1cec OpenSCAD: Support empty unions and SVG import 2022-09-11 16:48:50 -05:00
Günter Neiß
9884073276 OpenSCAD: remove SCAD-Import error in importCSG.py
Signed-off-by: Günter Neiß <gneiss@web.de>
2022-08-03 12:42:43 -04:00
Uwe
32ab100ed5 Mod: remove some superfluous Boolean checks (#7213)
* Mod: remove some superfluous Python Boolean checks
2022-07-19 01:35:12 +02:00
Chris Hennes
a6c5c12bea OpenSCAD: Fix difference action bug 2022-04-02 23:29:30 -05:00
Stefan Brüns
516b9c3bd0 [OpenSCAD] Avoid writing temporary parse cache file
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.
2022-03-31 10:39:49 -05:00
Chris Hennes
03414b9fd7 OpenSCAD: Fix for empty groups 2022-02-23 21:21:57 -06:00
wmayer
b0d8601562 OpenSCAD: make sure all unit tests pass in command line mode 2022-02-21 12:38:50 +01:00
Chris Hennes
0f2123b175 OpenSCAD: Support installation into read-only locations 2022-02-12 16:15:38 -06:00
Chris Hennes
9f1ee6b00e OpenSCAD: Add missing geometry check 2022-02-10 20:54:23 -06:00
Chris Hennes
6f11e63bf7 OpenSCAD: More fixes from Keith Sloan 2022-02-07 13:15:48 -06:00
Chris Hennes
f4a53c7eac OpenSCAD: Fixes in several actions from Keith Sloan 2022-01-30 20:19:20 -06:00
luz paz
b3ce571ad7 OpenSCAD: pep8-ified + removed superfluous whitespace + uniform headers 2022-01-23 19:52:37 -06:00
Chris Hennes
c45e054c2b OpenSCAD: Rewrite fixVisibility() to use rootObj
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.
2022-01-11 14:04:57 -06:00
luz paz
7b96b16cb8 Fix superfluous whitespace in various files 2022-01-09 21:01:42 -06:00
Chris Hennes
ba6fb8fb8e OpenSCAD: Handle missing script element from text() 2021-12-18 16:23:31 -06:00
Chris Hennes
1ef20ed984 OpenSCAD: Minor cleanup of import code 2021-11-07 21:50:48 -06:00
Chris Hennes
274544d868 [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
78b644e313 [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
Chris Hennes
cdf50cb47b [OpenSCAD] Fix missing hide() on linear extrude 2021-05-13 10:27:49 -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
46b0043b49 [OpenSCAD] Add additional recompute() logic 2021-03-29 13:58:52 -05: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
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
Chris Hennes
0a0d939522 [OpenSCAD] Add scale parameter to linear_extrude 2021-03-11 13:56:26 +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
helaslo
71fe41988b [OpenSCAD] Fix colors not working correctly when polygons are extruded 2021-02-25 15:08:19 +01:00
Chris Hennes
6b16e12d7c [OTHER] Catch only Exception, not BaseException 2021-02-11 11:52:45 +01: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
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
Keith Sloan
b6d5830cd6 fix resize 2020-06-05 13:17:34 +02:00
Keith Sloan
59e644c346 resize 2020-06-05 13:17:34 +02:00
Yorik van Havre
f52dfad5fa OpenSCAD: Add warning if PLY module is not found 2020-01-28 12:22:08 +01:00
Bernd Hahnebach
c2bfd781d1 OpenSCAD: file endings, normalize them and let git manage them 2019-12-19 22:26:24 +01:00
KeithSloan
7d74f91845 Add support for extrude with an angle 2019-09-04 11:38:34 -03:00
Yorik van Havre
bd346113cd OpenSCAD: Fixed issue #3640 2019-01-18 19:58:23 -02:00
Clemens Weissbacher
befb3ea8a8 py3: OpenSCAD: use io.open more explicit 2018-10-29 17:17:53 +01:00
Clemens Weissbacher
0d035d3f5b py3: OpenSCAD: make Mod/OpenSCAD python3 compatible 2018-10-25 11:03:36 -03:00