Commit Graph

379 Commits

Author SHA1 Message Date
59c7283dbc Reformat Code with black 19.10b
* Reformatted the code with `black` 19.10b. This is the version that's used by the Travis continuous integration check. The default version of `black` that comes with Conda is 20.8b1, which produces different formatting.

<environment.yml> should be updated to require the specific version of `black` used to check code before it's merged.
2021-02-14 18:40:39 -05:00
1caae595ed Add Support for Specifying Arbitrary Tangents, etc. to spline()
* Added support for specifying the tangents at arbitrary interpolation
points when interpolating a B-spline curve with `Workplane.spline()`.

* Added support for specifying whether the tangents should be
automatically scaled. (I.e., only use the tangent vector directions,
rather than their magnitudes.)

* Added support for specifying the value of the curve function
parameter at the interpolation points.

* Added support for specifying the interpolator's tolerance value.

Q: _There are a number of whitespace, and other formatting changes
introduced by `black`. Is there a specific list of parameters that you
use when running code formatting?_
2021-02-14 06:33:24 -05:00
0d96f63e94 Merge pull request #569 from RubenRubens/boolean
Boolean operation syntactic sugar
2021-02-12 12:04:57 -05:00
9bf351ab00 Initial 7.5 support 2021-02-12 17:56:47 +01:00
4f820109ed + operator test 2021-02-11 08:23:50 +01:00
b6beba7cb1 Centered option (#617)
* Added 2d centered option to rect

* Added single bool center option to box

* Add single bool center option to sphere

* Added single bool center option to wedge

* Added 2d centered option to rarray

* Black fix

* Centered docstrings

Change all docstrings for centered options to be consistent and more
clear

* Docstring fixes

* Fix type hint on wedge method
2021-02-10 18:02:43 +01:00
be851aa98b Added tests for wedge centering 2021-02-01 20:51:27 +10:30
94e0976119 Fix examples and start testing them (#609)
* Fix examples

* Added test for examples

* Fix example testing code

* Sweep example fix

* Reformat examples

* Test examples from the docs too

* Add docutils to the test requirements

* Example test fix on win+cleanup

* Use union
2021-01-31 19:00:21 +01:00
490f2720e6 fix .rect calls in tests 2021-01-30 21:39:03 +10:30
36d4178024 Expose SVG Export Options and Add Some Useful Extras (#596)
* Exposed getSVG opt parameter and added project dir

* Added additional options based on feedback

* Lint updates

* Added docstring for getSVG

* Fix strange black formatting suggestion.

Co-authored-by: Marcus Boyd <50230945+marcus7070@users.noreply.github.com>

* Fixed another Lint error that I did not see locally

* Added test for STL options

* Trying to get codecov to see that line 260 is covered

* Fixed copy-paste error of the wrong test

* Mention opt in the docstring

Co-authored-by: Marcus Boyd <50230945+marcus7070@users.noreply.github.com>
Co-authored-by: Adam Urbańczyk <adam-urbanczyk@users.noreply.github.com>
2021-01-28 22:04:35 +01:00
3348c18889 cutThruAll fix for non-planar faces (#604)
* reworked cutThruAll to support non-planar faces

* Added test
2021-01-26 08:49:15 +01:00
ccc1983c86 Added empty solve test 2021-01-19 08:12:50 +01:00
583a46b78e Use __or__ & __and__ 2021-01-16 10:58:51 +01:00
33286c2a60 Add syntactic sugar for boolean operations 2021-01-07 15:42:24 +01:00
428354c1ab More tests for the type selector 2021-01-04 08:48:11 +01:00
a74536008d More tests for >> 2021-01-03 20:27:24 +01:00
440e84dcb1 Merge branch 'master' into NthSelector 2021-01-03 15:48:02 +01:00
b5fb287a35 Tests for >> 2021-01-03 15:42:52 +01:00
2ca0e398b4 Fix broken CenterNthSelector tests 2021-01-03 15:26:35 +01:00
e19a05d023 ParallelDirSelector now filters for geomType() == "PLANE"
In certain circumstances this will be breaking, most commonly when using
DirectionNthSelector and there was previously a non-planar face in the
list. In this case eg. ">X[2]" will have to become ">X[1]".
2020-12-25 14:30:02 +10:30
88714975ff More tests for selectors 2020-12-19 15:41:04 +10:30
2d3fc607e6 Code formatting 2020-12-19 13:40:45 +10:30
82a043a0be Assembly hierarchy - 2nd take (#545)
* Reworked nested assy querying

* Support subclassing

* Added docstring
2020-12-18 08:40:24 +01:00
344651d1b3 Added CenterNthSelector and tests
Resolves #530.
2020-12-18 15:14:08 +10:30
f3751c25b2 additional checks in testParallelPlaneFaceFilter 2020-12-18 14:46:00 +10:30
6a6e39f7a7 Merge pull request #541 from marcus7070/selector-tests
Expanded selector tests
2020-12-13 20:23:31 -05:00
ac585b4ff1 Add glue option to combine() (#535)
* Update cq.py

Add glue option to combine()

* Update test_cadquery.py

Add test of glue=True to combine()

* Update test_cadquery.py

update testcombine()

* Update cq.py

Reformat combine()

* Reformat Black

* Update test_cadquery.py

Added tol=None to testCombine()

* Update test_cadquery.py

Correct testCombine()

* Update test_cadquery.py

* Update test_cadquery.py

* Update test_cadquery.py

Black formatting

* Update test_cadquery.py
2020-12-11 08:56:06 +01:00
de2cef9580 Expanded selector tests 2020-12-11 10:28:49 +10:30
a03648c842 Change to ProjectedOrigin (#532)
* Change to ProjectedOrigin

* Fix most tests

* Fix remaining tests

* Fix example building

* Update selector docs

* Fix the bottle+formatting changes

* Renamed centered to xycentered

* Ignore utils for coverage calculation
2020-12-08 18:32:57 +01:00
c42fa77ac0 Add mirror from face features (with example now fixed) (#527)
* Add the ability to mirror from a selected face

* Fix errors in example.rst

* Add mirror from face features (with example now fixed)

* recommit merge conflicts in shape.py that were stopping CI merging into master

* use correct variable name when selecting face

* formatting with black v19 instead of black v21

* add missing string literal types and clean up docstring

* Add volume assertions to the test cases

* black formatting

* Mypy fix

* Restructured mirror

* update examples to use basePoint instead of basePointVector

* Add tests for other workplane strings and non union option to increate code coverage

* Add test to check that exception is thown for incorrect input

* Go back to basePointVector

* Update arg naming in examples

* Mirror all objects

* Typo fix

Co-authored-by: Adam Urbańczyk <adam-urbanczyk@users.noreply.github.com>
2020-12-08 08:26:53 +01:00
cf275b0ec0 Constraints docs [WIP] (#524)
* Initial version of the constraints docs

* Adding the assy section

* apireference cleanup

* Include cutouts

* Roadmap cleanup

* _query cleanup

* Black fix

* Add RadiusNthSelector again

* Typo fix

* Paste error fix

* Show detailed selector docs

* Another typo fix

* Mention other constrain overload

* Added test for end()
2020-11-30 13:41:34 +01:00
b22436c59e Implement tag based constraint definition (#514)
* Refactor tags

* Use pyparsing for query parsing and implement tags

* Black and mypy fixes

* Allow "_" in names and tags

* Added tests

* Fixed constrain with tag test

* Better docstring for _query

* Typo fix
2020-11-24 17:46:21 +01:00
78d100dd05 Merge pull request #504 from marcus7070/marcus7070/edgeRadius
Radius selector
2020-11-20 07:01:50 -05:00
ec9cd46ea6 Merge pull request #482 from CadQuery/vrml-export
VRML export
2020-11-19 08:52:03 -05:00
5ec49c6cd1 Cover all code paths in VRML export 2020-11-19 08:22:35 +01:00
255b464509 Added RadiusNthSelector 2020-11-18 19:39:20 +10:30
3136ede020 Added radius method to Mixin1D 2020-11-18 19:39:17 +10:30
28d6089527 Expose mode for sweep operations. (#496)
* Expose mode for sweep operations

* Additional sweep functionality

* Fix sweep in cq

* Expose the new sweep args in Workplane

* fixed aux spine handling

* sweep test with a fixed normal

* Test aux spine sweep

* Added more tests

* Reformat sweep docs
2020-11-10 16:51:11 +01:00
65f9608f54 Implement locations() for Wires (#475)
* Implement locations() for Wires

* Fix errors

* Test for locations on a wire

* Refactored Mixin1D

* Mypy fixes and more refactoring

* black fix

* Moved _geomAdaptor to concrete classes

* Add positionAt

* Added positions()

* positions() and positionAt() test

* Better tests

* Extended tangentAt and added docstrings

* Test for tangentAt

* Fixed defects

* Doc fix attempt

* Use autoclass on Mixins

* specify full name in sphinx
2020-10-30 22:31:51 +01:00
cac5cf92f1 Create a child workplane on a vertex (#480)
* add parent face detection to workplane()

* Update cq.py

* add nonetype check and tests

* fixed test formatting

* mypy fix attempt

Co-authored-by: Adam Urbańczyk <adam-urbanczyk@users.noreply.github.com>
2020-10-15 21:10:49 +02:00
d43ed8f665 Added test 2020-10-14 19:07:47 +02:00
3a50edd27d Merge pull request #453 from cactrot/fontPath
Font path
2020-10-14 11:42:33 -04:00
292a0d8d0a Merge pull request #440 from CadQuery/assembly
Assembly support
2020-10-01 06:48:06 -04:00
8f62fc54dd Review fixes 2020-10-01 08:33:03 +02:00
32f25f7164 rarray: bound spacings to greater than 0 (#454)
* rarray: bound spacings to greater than 0
This addresses Issue 451

* Fix a typo. (#452)

* Fix a typo.

* Pin black version in travis

Co-authored-by: Adam Urbańczyk <adam-urbanczyk@users.noreply.github.com>

* rarray: bound spacings to greater than 0
This addresses Issue 451

* Added test for rarray error handling

Co-authored-by: Kevin Menard <kevin@nirvdrum.com>
Co-authored-by: Adam Urbańczyk <adam-urbanczyk@users.noreply.github.com>
2020-09-27 17:05:04 +02:00
c819dfca48 Fix dxf arc export for some partial circles (#455)
* Fix dxf arc export for some partial circles

* Fix dxf export formatting, add test

* Black related update

Co-authored-by: Scott Nagy <i@sna.gy>
Co-authored-by: Adam Urbańczyk <adam-urbanczyk@users.noreply.github.com>
2020-09-27 15:33:59 +02:00
2625e21a19 Tighter tolerances on the solve 2020-09-26 20:45:22 +02:00
a1bb80741c Update test_cadquery.py
Check for non-existent file instead of trying to use it and possibly segfaulting.
2020-09-26 07:26:38 -04:00
a24d6bf502 Relaxed test criteria 2020-09-25 18:43:05 +02:00
b6484959ed Better assy.solve() test 2020-09-25 08:57:24 +02:00