Make that two nodes x and y are equal, i.e. merge their value node.
(self, x: gm.Node, y: gm.Node, deps: Dependency)
| 1003 | return nm.check_sameside([p.num for p in points]) |
| 1004 | |
| 1005 | def make_equal(self, x: gm.Node, y: gm.Node, deps: Dependency) -> None: |
| 1006 | """Make that two nodes x and y are equal, i.e. merge their value node.""" |
| 1007 | if x.val is None: |
| 1008 | x, y = y, x |
| 1009 | |
| 1010 | self.connect_val(x, deps=None) |
| 1011 | self.connect_val(y, deps=None) |
| 1012 | vx = x._val |
| 1013 | vy = y._val |
| 1014 | |
| 1015 | if vx == vy: |
| 1016 | return |
| 1017 | |
| 1018 | merges = [vx, vy] |
| 1019 | |
| 1020 | if ( |
| 1021 | isinstance(x, Angle) |
| 1022 | and x not in self.aconst.values() |
| 1023 | and y not in self.aconst.values() |
| 1024 | and x.directions == y.directions[::-1] |
| 1025 | and x.directions[0] != x.directions[1] |
| 1026 | ): |
| 1027 | merges = [self.vhalfpi, vx, vy] |
| 1028 | |
| 1029 | self.merge(merges, deps) |
| 1030 | |
| 1031 | def merge_vals(self, vx: gm.Node, vy: gm.Node, deps: Dependency) -> None: |
| 1032 | if vx == vy: |
no test coverage detected