Skip to content

Commit

Permalink
topology.py -> add xor (^) location_at operator to the curve class
Browse files Browse the repository at this point in the history
  • Loading branch information
jdegenstein authored Jan 12, 2024
1 parent 921fc9d commit 614d4de
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/build123d/topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -4253,14 +4253,18 @@ class Curve(Compound):

_dim = 1

def __matmul__(self, position: float):
def __matmul__(self, position: float) -> Vector:
"""Position on curve operator @ - only works if continuous"""
return Wire.make_wire(self.edges()).position_at(position)

def __mod__(self, position: float):
def __mod__(self, position: float) -> Vector:
"""Tangent on wire operator % - only works if continuous"""
return Wire.make_wire(self.edges()).tangent_at(position)

def __xor__(self, position: float) -> Location:
"""Location on wire operator ^ - only works if continuous"""
return Wire.make_wire(self.edges()).location_at(position)

def wires(self) -> list[Wire]:
"""A list of wires created from the edges"""
return Wire.combine(self.edges())
Expand Down

0 comments on commit 614d4de

Please sign in to comment.