Commit Graph

109 Commits

Author SHA1 Message Date
1d3fc576cb typo fix 2021-03-21 20:34:51 +01:00
8c15d18514 Implement parametricSurface 2021-03-21 18:44:31 +01:00
50bada403f Added tests for Face.makeSplineApprox 2021-03-19 22:32:38 +01:00
54831144a2 test for makeSplineApprox 2021-03-18 19:50:05 +01:00
a54de640ff Improve Inheriting Workplane Fluent Methods (#677)
* Return Instances of the Type of self from Fluent Methods

* Updated `Workplane.workplane()`, `Workplane.copyWorkplane()`, `Workplane.newObject()` to return instances of a type that's based on the input parameters (such as `self`).
* Updated type hints to reflect that return types of fluent methods depend on the type of method arguments.
* Added a unit test to verify fluent methods in a derived class return instances of the derived class.

* Fix Workpane MyPy Errors

* Fixed type hints in `sweep()` and `_selectObjects()`.

* Fix `test_cadquery.py` Formatting

* Ran `black` on `test_cadquery.py`.

* Renamed `TypeVar` `WorkplaneT` to `T`

* Renamed `WorkplaneT` to `T` in `cq.py`.

* Reformat with Black

* Re-formatted `cq.py` with `black`.

* Re-format with the Right Version of Black (19.10b0)

* Re-formatted `cq.py` with `black` 19.10b0.
2021-03-12 07:34:54 +01:00
5542816447 2D fillet chamfer (#683)
* Implement 2D chamfers and fillets

* Implement 2D chamfer/fillet tests

Co-authored-by: Marcus Boyd <mwb@geosol.com.au>
2021-03-12 07:05:56 +10:30
d7e7812c4c Merge branch 'master' into getPending 2021-03-10 08:54:27 +01:00
48deb19b68 Initial implementation of CompSolid 2021-03-10 13:14:38 +10:30
7be6070534 Use popPending methods 2021-03-08 14:22:47 +10:30
b316461b49 Added popPendingEdges and popPendingWires to CQ Context
Also tests
2021-03-08 14:17:47 +10:30
0325474f72 findSolid errors (#655)
* findSolid returns None when no solids found

Removed a line in the findSolid docstring about raising an error if no
solids found. Added exceptions to several methods that were previously
failing with AttributeErrors when they tried to treat the None object as
a solid.

* findSolid needed type hint Optional on it's return value

* Type hint and test Workplane.findFace

* Rewrite to raise ValueError in findSolid

* I forgot about findFace again

* add exceptions to docstrings
2021-03-03 21:03:19 +01:00
0885b198b1 Merge branch 'master' into 7.5 2021-02-26 23:05:02 +01:00
606eb2773e offset2D for construction (#639)
* Added forConstruction option to Workplane.offset2D

* Added Workplane.offset2D example

Co-authored-by: Adam Urbańczyk <adam-urbanczyk@users.noreply.github.com>
2021-02-19 10:49:09 +10:30
3505fc2ff6 Merge pull request #636 from pavpen/spline-tangents-parameters-tolerance
Add Support for Specifying Arbitrary Tangents, etc. in spline()
2021-02-18 20:57:35 +10:30
8d2c0b90c2 Black 19.10 fix 2021-02-18 11:02:55 +10:30
ff0b123889 Test periodic splines with parameters 2021-02-18 10:38:49 +10:30
6f5f0cc984 Validate Edge.makeSpline parameters for periodic splines 2021-02-18 10:38:36 +10:30
b5e4aa940f Validate Edge.makeSpline parameters input 2021-02-18 07:20:40 +10:30
9efe66c482 Fix Unit Test after Rename of spline() Parameter tolerance to tol
* Fixed the `testSplineTangentMagnitudeBelowToleranceThrows` unit test. It was failing since `spline()`'s parameter `tolerance` seems to have been renamed to `tol`.
2021-02-17 14:02:27 -05:00
bec5036d34 Additional test for spline 2021-02-17 18:04:29 +01:00
172ae85c01 Put Spline scale Parameter Tests Cases Together
* Moved the tests cases, so they're next to each other.
* Added a comment about the relationship between the two test cases.
2021-02-17 06:06:34 -05:00
0dcccc351d tangentAt fix (#641)
* tangentAt fix

* Better testTangengAt

* Change default to length

* tests fix
2021-02-15 21:18:09 +01:00
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
490f2720e6 fix .rect calls in tests 2021-01-30 21:39:03 +10:30
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
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
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
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
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
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
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
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
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
26de7bc9c2 Update test_cadquery.py
Changed directory to point to test data.
2020-09-24 13:29:59 -04:00
00a1329c2e Update test_cadquery.py
Perhaps the call to os.path.join will allow the tests to run.
2020-09-22 21:48:26 -04:00
8dd1038226 Update test_cadquery.py
Try pulling a valid path from elsewhere in the file.
2020-09-22 17:25:20 -04:00
31d4a4f79a Update test_cadquery.py
Try just the current directory.
2020-09-22 17:08:16 -04:00
f934f45bf7 Update test_cadquery.py
Trying Unix style path.
2020-09-22 16:49:21 -04:00
6b2df42ed6 Update test_cadquery.py
Add test for "text" using fontPath keyword argument.
2020-09-22 16:36:58 -04:00