Commit Graph

80 Commits

Author SHA1 Message Date
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
Keith Sloan
e377166f6f improve csg import 2018-08-29 21:45:41 +02:00
luzpaz
c4dd42de98 Typos: Various workbenches and misc.
[skip ci]
2017-12-25 10:58:10 +01:00
luzpaz
f3bf8fe919 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
f1bdd58c74 py3: fix some simple incompapilities
issue 0000995
2017-06-21 11:25:30 +02:00
wmayer
831ceae546 py3: port PR changes to be compatible with Py3 2017-05-18 16:25:13 +02:00
Keith Sloan
13f7ca7f2d Fix for Polyhedron with faces 2017-05-18 16:18:53 +02:00
Keith Sloan
80d1231068 Fix for cylinder with polygon number as a decimal 2017-05-17 11:24:29 -03:00
Keith Sloan
a4e2dedb2a Fix for circlee with zero radius 2017-05-17 05:45:55 +01:00
Keith Sloan
c37e13b76d Fix for linear_extrude request of null object i.e. null text 2017-05-11 20:21:54 +02:00
Keith Sloan
2d1c913300 Support of OpenSCAD offset command 2017-05-02 15:53:30 +02:00
Keith Sloan
779c8a4e43 Fix for null string and single blank string 2017-04-28 19:59:29 +02:00
Kunda
a7414e5789 source typo fixes pt1 (only on py3 merged code)
issue 0002914
2017-02-27 11:32:47 +01:00
Priit Laes
839e7eed22 python: OpenSCAD: *.py: Fix python3 syntax 2017-02-12 17:40:07 +01:00
wmayer
7b631625c7 if UnicodeUTF8 is not defined use a fallback implementation of translate() 2016-12-27 20:12:39 +01:00
Keith Sloan
27b37c50c8 Tidy up of text command support 2016-10-08 22:15:28 +02:00
Keith Sloan
a9173e95ab First attempt at support for CSG text command 2016-09-22 10:18:24 -03:00
Yorik van Havre
f23582c994 OpenSCAD: allow to enable verbose output in preferences 2016-02-03 12:04:48 -02:00
Sebastian Hoogen
684f5788be adapt importCSG to makeFace property and change in importDXF
in commit 06a689eff2
2015-02-24 16:36:25 +01:00
Sebastian Hoogen
a9955d490e importOpenSCAD: support for projection(cut=true) 2014-11-23 19:26:28 -02:00
Sebastian Hoogen
7db2cdc008 use Icons for Refine and Increase tolerance features 2014-10-11 13:09:33 +02:00
Sebastian Hoogen
856c66d12d use exceptions in OpenSCAD module
derive OpenSCADError from FreeCADError if possible
2014-09-17 11:59:49 +02:00
wmayer
fe9e77d661 + fixes #0001617: typo in importCSG.py 2014-07-16 15:11:45 +02:00
Sebastian Hoogen
51dd1b4ebb remove unused tokens in importCSG 2014-06-10 10:36:08 -03:00