Commit Graph

80 Commits

Author SHA1 Message Date
Chris Hennes
0b50daec4d OpenSCAD: Handle missing script element from text() 2021-12-18 16:23:31 -06:00
Chris Hennes
02c1277a1d OpenSCAD: Minor cleanup of import code 2021-11-07 21:50:48 -06: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
Chris Hennes
99f9c3405c [OpenSCAD] Fix missing hide() on linear extrude 2021-05-13 10:27:49 -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
b18cabae05 [OpenSCAD] Add additional recompute() logic 2021-03-29 13:58:52 -05: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
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
Chris Hennes
bfce108083 [OpenSCAD] Add scale parameter to linear_extrude 2021-03-11 13:56:26 +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
helaslo
d29fd7d9cb [OpenSCAD] Fix colors not working correctly when polygons are extruded 2021-02-25 15:08:19 +01:00
Chris Hennes
3ef6e1c6d0 [OTHER] Catch only Exception, not BaseException 2021-02-11 11:52:45 +01:00
wmayer
ec5bbad626 OpenSCAD: [skip ci] Coverity: Bad use of null-like value 2020-09-22 14:22:10 +02:00
hrobeers
aaf12da9d0 [OpenSCAD] consistent FreeCADGui imports, fixes headless CSG import 2020-09-14 13:28:40 +02:00
wmayer
8280783795 OpenSCAD: [skip ci] set default of 16 for useMaxFN parameter 2020-08-06 09:47:25 +02:00
wmayer
4c1f029c25 OpenSCAD: [skip ci] set default of 16 for useMaxFN parameter 2020-08-06 08:48:53 +02:00
Keith Sloan
ea9c61869e fix resize 2020-06-05 13:17:34 +02:00
Keith Sloan
f333d9ca0f resize 2020-06-05 13:17:34 +02:00
Yorik van Havre
630fc040a9 OpenSCAD: Add warning if PLY module is not found 2020-01-28 12:22:08 +01:00
Bernd Hahnebach
75b7cab2d1 OpenSCAD: file endings, normalize them and let git manage them 2019-12-19 22:26:24 +01:00
KeithSloan
349acc75ad Add support for extrude with an angle 2019-09-04 11:38:34 -03:00
Yorik van Havre
ed06cbe626 OpenSCAD: Fixed issue #3640 2019-01-18 19:58:23 -02:00
Clemens Weissbacher
1be9f18b52 py3: OpenSCAD: use io.open more explicit 2018-10-29 17:17:53 +01:00
Clemens Weissbacher
cef825c567 py3: OpenSCAD: make Mod/OpenSCAD python3 compatible 2018-10-25 11:03:36 -03:00
Keith Sloan
c717d1121d improve csg import 2018-08-29 21:45:41 +02:00
luzpaz
128239b54a Typos: Various workbenches and misc.
[skip ci]
2017-12-25 10:58:10 +01:00
luzpaz
ab8f8919b6 Misc. typos
+ some are doxy others are just comment code.  
+ some minor whitespace and grammatical tweaks. 
+ app/SCL/* typos have also been submitted upstream (https://github.com/stepcode/stepcode/pull/366). So it's ok to merge them in to master.
2017-10-04 17:59:11 +02:00
looooo
3e8249a0e6 py3: fix some simple incompapilities
issue 0000995
2017-06-21 11:25:30 +02:00
wmayer
5fbca1a4ad py3: port PR changes to be compatible with Py3 2017-05-18 16:25:13 +02:00
Keith Sloan
ce8a423f2e Fix for Polyhedron with faces 2017-05-18 16:18:53 +02:00
Keith Sloan
22cbd5b825 Fix for cylinder with polygon number as a decimal 2017-05-17 11:24:29 -03:00
Keith Sloan
8904d65aab Fix for circlee with zero radius 2017-05-17 05:45:55 +01:00
Keith Sloan
1e04f7da75 Fix for linear_extrude request of null object i.e. null text 2017-05-11 20:21:54 +02:00
Keith Sloan
a328e1fe73 Support of OpenSCAD offset command 2017-05-02 15:53:30 +02:00
Keith Sloan
6ffe8837c4 Fix for null string and single blank string 2017-04-28 19:59:29 +02:00
Kunda
dde52952f4 source typo fixes pt1 (only on py3 merged code)
issue 0002914
2017-02-27 11:32:47 +01:00
Priit Laes
159dbe2cb8 python: OpenSCAD: *.py: Fix python3 syntax 2017-02-12 17:40:07 +01:00
wmayer
f065f8eb53 if UnicodeUTF8 is not defined use a fallback implementation of translate() 2016-12-27 20:12:39 +01:00
Keith Sloan
e0b9e29db9 Tidy up of text command support 2016-10-08 22:15:28 +02:00
Keith Sloan
b5826607d9 First attempt at support for CSG text command 2016-09-22 10:18:24 -03:00
Yorik van Havre
f3d66aa674 OpenSCAD: allow to enable verbose output in preferences 2016-02-03 12:04:48 -02:00
Sebastian Hoogen
a77106a58f adapt importCSG to makeFace property and change in importDXF
in commit 06a689eff2
2015-02-24 16:36:25 +01:00
Sebastian Hoogen
428b47d74a importOpenSCAD: support for projection(cut=true) 2014-11-23 19:26:28 -02:00
Sebastian Hoogen
05af9207a3 use Icons for Refine and Increase tolerance features 2014-10-11 13:09:33 +02:00
Sebastian Hoogen
333e6e3155 use exceptions in OpenSCAD module
derive OpenSCADError from FreeCADError if possible
2014-09-17 11:59:49 +02:00
wmayer
7120279ec0 + fixes #0001617: typo in importCSG.py 2014-07-16 15:11:45 +02:00
Sebastian Hoogen
fc31b3179a remove unused tokens in importCSG 2014-06-10 10:36:08 -03:00