Commit graph

321 commits

Author SHA1 Message Date
Matti Eiden
3678691dff Support multidimensional minus in algebra mode
Previously algebra minus had a check that verified all arguments were
of same dimension. However OCCT supports cutting a shape with shapes
that are of equal OR larger dimension. This commit modifies the check
to support larger dimensions and adds tests for all dimension
variations.
2024-01-07 01:08:49 +02:00
jdegenstein
6e59510452
test_build_common.py -> add xor (^) test for operator returning location 2024-01-04 10:40:25 -06:00
jdegenstein
c75e8d3123
Update test_build_sketch.py -> Trapezoid tests
add coverage for Trapezoid changes
2023-12-11 11:24:40 -06:00
gumyr
b2eb1fb1b7 Fixed workplanes popping problem Issue #399 2023-12-11 11:25:59 -05:00
gumyr
43ca34da2c Enabling flatten_sequence to work with nested iterables Issue #429 2023-12-11 10:37:00 -05:00
gumyr
3a5a4e5bf4 Adding test coverage to joint deepcopy 2023-12-08 20:24:00 -05:00
gumyr
4f79ce745c Added the Triangle Sketch object 2023-12-08 16:06:45 -05:00
jdegenstein
0b3c04e042 remove one failing test that does not apply to the new Rotation class 2023-12-05 13:38:13 -06:00
jdegenstein
7df69d40fb Merge branch 'RotOrder2' of https://github.com/jdegenstein/build123d into RotOrder2 2023-12-05 13:34:37 -06:00
jdegenstein
e0ad6b8b2a add a few more tests for Rotation parameters 2023-12-05 13:34:02 -06:00
jdegenstein
558e65846a
Update test_build_enums.py, add missing Enums 2023-12-04 20:19:04 -06:00
jdegenstein
b14971af9a
Update test_direct_api.py, add a few more tests 2023-12-04 20:15:53 -06:00
jdegenstein
8a225eeb28 adding additional tests to cover new rotation ordering 2023-12-04 16:56:03 -06:00
gumyr
f892032728 Improved Wire.trim 2023-12-02 11:04:45 -05:00
Roger Maitland
b9e6593257
Merge pull request #397 from jdegenstein/loftvertices
Add vertices support to loft
2023-11-30 09:47:17 -05:00
gumyr
34db0aae78 Added ability to accept iterables to: Builders, Locations, Bezier,
FilletPolyline, Line, Polyline, Spline, TangentArc, ThreePointArc,
Polygon, Issue #269
2023-11-29 13:53:53 -05:00
jdegenstein
b7a68a87c3 add tests, simplify and improve loft logic 2023-11-27 10:07:24 -06:00
gumyr
2a747b37a2 Fixing Location * GridLocations 2023-11-25 19:23:07 -05:00
gumyr
89fda66873 Adding LocationEncoder to store Locations as JSON 2023-11-25 19:13:32 -05:00
Roger Maitland
b8d6aa1f3b
Merge pull request #371 from MatthiasJ1/builder_context_selectors
Add Builder context-aware selectors
2023-11-22 09:23:38 -05:00
gumyr
49c0a60eec Adding hex color codes to Color 2023-11-19 09:06:29 -05:00
Roger Maitland
ef8ace0261
Merge branch 'dev' into builder_context_selectors 2023-11-15 14:12:30 -05:00
Ami Fischman
aef4eb809d Speed up test_pack.py by fuse()ing once per test case.
A classic case of the win described by
https://build123d.readthedocs.io/en/latest/algebra_performance.html

Before, these test cases took 1.26s and 0.28s, making them the slowest
and 8th-slowest test cases in the entire repo according to `py.test
--durations=10`, and a full pytest run takes 12.31s.

After, these test cases both take 0.09s, and a full run takes 10.90s.

Also added `prof/` to `.gitignore` because using pytest's
`--profile{-svg}` options creates this directory but it is unlikely to
be usefully tracked by git.
2023-11-15 11:03:21 -08:00
Ami Fischman
b16f927abc Speed up pytest execution wall time by ~37%.
Before: `644 passed in 19.89s`.
After: `644 passed in 12.47s`.

Running with `python -m pytest --durations=5` showed this test case
was a huge outlier, and timing its execution showed a huge disparity
between the time `TechnicalDrawing` thought it took to run and the
time its caller saw et up. Dropping the Builder context makes these
times lineup.

Tested the individual test case speed-up with `hyperfine -- 'python -m pytest tests/test_drafting.py::TestTechnicalDrawing::test_basic_drawing'`
which reports before & after of:

```
Benchmark 1: python -m pytest tests/test_drafting.py::TestTechnicalDrawing::test_basic_drawing
  Time (mean ± σ):      9.488 s ±  0.534 s    [User: 9.525 s, System: 1.478 s]
  Range (min … max):    9.117 s … 10.929 s    10 runs

Benchmark 1: python -m pytest tests/test_drafting.py::TestTechnicalDrawing::test_basic_drawing
  Time (mean ± σ):      1.951 s ±  0.040 s    [User: 2.292 s, System: 1.111 s]
  Range (min … max):    1.871 s …  2.020 s    10 runs
```

I dug a little into why it was so much slower under the builder and
the answer seems to be ~13k calls to deepcopy, but I haven't dug
deeper yet to figure out if there's a way to "transfer" to the builder
rather than making copies.
2023-11-14 16:48:23 -08:00
gumyr
99be3df220 Changing is_closed to a property Issue #357 2023-11-13 19:55:00 -05:00
gumyr
499e43c897 Added kwargs to vector classes Issue #376 2023-11-12 10:38:46 -05:00
Ami Fischman
dd649308c1 pack(): update to support Shape, not just Part.
Also fix SlotOverall so that passing it equal height and width doesn't
error out and instead reduces to a Circle. (bug discovered while
writing the new test case).
2023-11-10 09:07:54 -08:00
Roger Maitland
86c639c0d0
Merge pull request #374 from fischman/fischman/pack2d
pack(): introduced a new helper for packing parts into a 2D footprint.
2023-11-10 10:01:48 -05:00
Scott Barlow
081517cc14 Couple more 2023-11-10 00:22:11 -08:00
Ami Fischman
b767b78a69 pack(): introduced a new helper for packing parts into a 2D footprint.
Also added documentation for the new facility as well as a nascent
CONTRIBUTING.md to collect pointers to the tools used by developers of
this project.
2023-11-09 15:06:49 -08:00
MatthiasJ
b782027440 remove BuildLine wire equality test 2023-11-09 11:35:47 -07:00
MatthiasJ
70c1705e3f tests 2023-11-09 00:02:02 -07:00
gumyr
cdd00771f5 Added endpoint to PolarLocations 2023-11-08 10:42:14 -05:00
gumyr
0402921317 VectorLike takes Vertex via Iterable 2023-11-07 11:51:47 -05:00
gumyr
6f9a5eface Removed Vertex.to_vector() - replaced with Vector(Vertex) 2023-11-05 10:30:43 -05:00
gumyr
0735da11ba Fixed offset with no results Issue #362 2023-11-04 14:53:26 -04:00
snoyer
10b4448d26 add SVG color test 2023-11-04 14:09:12 +04:00
Roger Maitland
b546986d67
Merge pull request #360 from MatthiasJ1/shapelist_intersection
Add intersection operator, &, to ShapeList
2023-11-02 16:11:42 -04:00
MatthiasJ
a76e61f095 test 2023-11-02 12:53:24 -06:00
gumyr
17a1e09a38 Face.wire() returns outer_wire & generates warning if inner_wires 2023-11-02 10:32:56 -04:00
gumyr
45e0433bea Improved sweep by ordering edges 2023-11-01 19:20:34 -04:00
MatthiasJ
2577923906 Merge branch 'dev' into filter_by_plane 2023-10-31 11:14:49 -06:00
Ruud Swinkels
75de536c53 add axis equality testcases 2023-10-29 21:27:40 +01:00
Ruud Swinkels
ff80caf723 fix axis equality 2023-10-29 21:20:03 +01:00
MatthiasJ
80a5729a5a Add non-planar curve to filter_by(Plane) tests 2023-10-28 14:45:38 -06:00
MatthiasJ
9b72b4648e Add ability to filter faces/edges based on whether they are parallel to an arbitrary plane 2023-10-28 14:08:01 -06:00
gumyr
4eabb17e60 Fix Compound.is_manifold Issue #353 2023-10-24 11:09:56 -04:00
gumyr
63dc6c5941 Fixed path to svg file 2023-10-21 11:53:20 -04:00
gumyr
dd4f923f6c Changing import_svg to use ocpsvg 2023-10-21 11:22:11 -04:00
gumyr
ee8517f4a4 Removing warnings 2023-10-21 11:12:14 -04:00