mirror of
https://github.com/gumyr/build123d.git
synced 2026-01-18 07:11:58 -08:00
Added Face.position_at(u,v)
This commit is contained in:
parent
8a2abd1b07
commit
01e6d46da6
1 changed files with 25 additions and 1 deletions
|
|
@ -4317,7 +4317,31 @@ class Face(Shape):
|
|||
|
||||
return Vector(normal)
|
||||
|
||||
def center(self, center_of=CenterOf.GEOMETRY):
|
||||
def position_at(self, u: float, v: float) -> Vector:
|
||||
"""position_at
|
||||
|
||||
Computes a point on the Face given u, v coordinates.
|
||||
|
||||
Args:
|
||||
u (float): the horizontal coordinate in the parameter space of the Face,
|
||||
between 0.0 and 1.0
|
||||
v (float): the vertical coordinate in the parameter space of the Face,
|
||||
between 0.0 and 1.0
|
||||
|
||||
Returns:
|
||||
Vector: point on Face
|
||||
"""
|
||||
u_val0, u_val1, v_val0, v_val1 = self._uv_bounds()
|
||||
u_val = u * (u_val0 + u_val1)
|
||||
v_val = v * (v_val0 + v_val1)
|
||||
|
||||
gp_pnt = gp_Pnt()
|
||||
normal = gp_Vec()
|
||||
BRepGProp_Face(self.wrapped).Normal(u_val, v_val, gp_pnt, normal)
|
||||
|
||||
return Vector(gp_pnt)
|
||||
|
||||
def center(self, center_of=CenterOf.GEOMETRY) -> Vector:
|
||||
"""Center of Face
|
||||
|
||||
Return the center based on center_of
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue