Commit graph

433 commits

Author SHA1 Message Date
gumyr
b81fecd8dc Added tuple as valid input to Color Issue #727 2024-10-07 10:13:32 -04:00
gumyr
cf1f869d7d Added tuple as valid input to Color Issue #727 2024-10-07 10:12:56 -04:00
gumyr
f1a9c58900 Fixed split with nested Compounds Issue #698 2024-10-04 11:40:25 -04:00
gumyr
04cf1efd89 Fixed param_at_point Issues #570 & #708 2024-10-02 15:44:10 -04:00
Roger Maitland
720bee9fa0
Merge pull request #707 from alexer/fix-eq
Fix __eq__ and __ne__ for classes implementing them
2024-09-22 10:10:13 -04:00
Aleksi Torhamo
acbebfb017 Fix __eq__ and __ne__ for classes implementing them
Main issue, which concerns Vector, Location, and ShapeList:

Comparison with an object of a different type should not cause an
exception - they are simply not equal. Raising an exception in __eq__
can (and will*) break unrelated code that expects __eq__ to be well-behaved.

(* I noticed this bug when cq-editor choked on it while trying to find
   a name for an object in a dictionary of local variables)

There's a second more minor issue, which concerns the rest of the classes:

When the other type in __eq__ is not supported, one should technically
return NotImplemented instead of False, to allow the other type to take
part in the comparison, in case they know about our type.

(__ne__ should also not generally be implemented as just the negation of
__eq__ because of this, but that's also a moot point because the __ne__
can just be removed - Python will automatically do the right thing based
on __eq__ here)

Technically, the __eq__ for Vector and Plane is also broken in another way:
It's not transitive.

>>> a, b, c = Vector(0), Vector(9e-6), Vector(18e-6)
>>> a == b == c
True
>>> a == c
False

They should really eg. have a separate is_close() for approximate comparison,
but this isn't fixed here, since I have no idea how many places it'd break,
for one.
2024-09-22 08:07:00 +03:00
gumyr
043629ec87 Enhanced offset to allow holes to grow outside of the Face Issue #702 2024-09-20 11:29:19 -04:00
Roger Maitland
debdf845bf
Merge pull request #695 from danieledapo/dev
Fix thicken normal calculation when no override is provided
2024-09-19 14:33:21 -04:00
gumyr
99b378f27a Added Compound.unwrap & Compound.len as part of fix of Issue#694 2024-09-19 14:13:50 -04:00
Daniele D'Orazio
82f3dd8011 fix normal_override overwrite in thicken 2024-09-19 09:23:01 +02:00
gumyr
88a40574a8 Added Shell.sweep Issue #622 2024-09-07 11:31:10 -04:00
Daniele D'Orazio
dfb1cee937 more position_at tests 2024-08-30 17:43:29 +02:00
Daniele D'Orazio
8527fe8664 fix location_at, position_at and tangent_at with PositionMode.LENGTH for Wire 2024-08-30 17:16:35 +02:00
jdegenstein
7f8223b50d
test_direct_api.py -> reenable test that fail(ed) on MacOS arm64 2024-08-29 13:29:06 -05:00
gumyr
347de4277d Disabling test that fails only on Arm Macs 2024-08-29 11:57:33 -04:00
gumyr
722165dc25 Fixed Wire.trim Issue #676 2024-08-29 11:47:21 -04:00
gumyr
3d0cdcf4e1 Adding support for Windows 2024-08-21 15:41:03 -04:00
gumyr
fd4b16b529 Fixed step import of assembly Issue #671 2024-08-21 15:16:24 -04:00
Michael Bugert
c7b6bb7364 import_step: do not assign labels to Compound.for_construction 2024-07-24 22:33:37 +02:00
gumyr
410007d304 Fixed Face.is_coplanar for flipped Faces - Issue #661 2024-07-20 10:36:55 -04:00
gumyr
55c22311e6 Improved Vector.__str__/__repr__ 2024-07-14 11:57:08 -04:00
gumyr
e29c9fb255 Added Face.location_at & _ocp_section 2024-07-02 07:49:51 -04:00
gumyr
ce20991745 Replaced Axis.as_infinite_edge with Edge __init__ method Issue #648 2024-06-24 13:47:52 -04:00
jdegenstein
b40bcf9a24
Merge pull request #647 from jdegenstein/plane.isometric
Propose adding `Plane.isometric` to built-in planes
2024-06-24 10:39:00 -05:00
jdegenstein
74f5f68bdc
test_build_line.py -> add test for vertex/start position 2024-06-24 10:19:42 -05:00
jdegenstein
d0f4fbfa62
test_direct_api.py -> add test for Plane.isometric 2024-06-24 09:10:06 -05:00
jdegenstein
bab54c7984
test_direct_api.py -> rename vec_dir to is_direction 2024-06-23 13:39:16 -05:00
jdegenstein
f2d4ddaeea
Merge branch 'dev' into jernArcFix1 2024-06-23 13:11:12 -05:00
gumyr
ce72ee2435 Added geometry intersections Issue #327 #328 2024-06-23 13:48:30 -04:00
jdegenstein
99863e8307
Update test_build_line.py -> Fix tests 2024-06-21 15:21:25 -05:00
jdegenstein
23f6fb9618
test_build_line.py -> less trivial JernArc tests 2024-06-21 15:18:45 -05:00
jdegenstein
644edc99a3
test_direct_api.py -> add vector transform tests 2024-06-21 14:11:47 -05:00
jdegenstein
29ad5386aa
Merge pull request #643 from jdegenstein/hexloc_majradius
Add major_radius bool to HexLocations and rename apothem parameter to radius
2024-06-19 20:48:03 -05:00
gumyr
35a33f8d3e Added Plane.find_intersection(Plane) Issue #327 2024-06-19 18:43:14 -04:00
jdegenstein
43a1d93115
test_build_common.py -> fix deprecated assertAlmostEquals with assertAlmostEqual 2024-06-19 15:43:03 -05:00
jdegenstein
f8291b0bb2
test_build_common.py -> add test for HexLocations(... major_radius = True) 2024-06-19 15:36:32 -05:00
gumyr
2c40e19141 Fixed intersections of Axis Issue #615 2024-06-19 11:42:36 -04:00
gumyr
4561105666 Added new Edge.trim_to_length feature 2024-06-14 12:06:36 -04:00
gumyr
62d762b90a Removing bd_warehouse test dependency 2024-06-12 10:47:20 -04:00
gumyr
fd123eb4a0 Removing bd_warehouse test dependency 2024-06-12 10:43:30 -04:00
gumyr
8a3ee82b5d Handling null TDF Label - Fix Issue #618 2024-06-12 10:26:01 -04:00
gumyr
ad55863d30 Fixing Issue #475 2024-06-12 09:57:26 -04:00
gumyr
56d24c08c0 Fixed Issue #423 2024-06-11 11:40:02 -04:00
Zack Yancey
96f4e11e6d Add a test for revolute joints around an axis other than Z 2024-06-06 18:16:03 -07:00
gumyr
7b540e143f Fixed Issue #428, added Joints.location property, improved some joint symbols 2024-06-06 14:47:24 -04:00
gumyr
7a1cfc1f8b import_step supports colors and labels 2024-05-22 10:12:57 -04:00
gumyr
78a30a7676 Face.normal_at takes point or u,v Issue #410 2024-03-23 15:17:40 -04:00
gumyr
34620704ac Color improvements: inheritance & iterable 2024-03-23 13:50:05 -04:00
gumyr
8d46faef41 Fixed Face.center_location Issue #599 2024-03-22 14:22:55 -04:00
gumyr
7bbd9ea2b7 Moved exporters to functions 2024-03-22 11:49:11 -04:00