orient_points
- compas.geometry.orient_points(points, reference_plane, target_plane)[source]
Orient points from one plane to another.
- Parameters:
- pointssequence[[float, float, float] |
compas.geometry.Point
] XYZ coordinates of the points.
- reference_plane[point, vector]
Base point and normal defining a reference plane.
- target_plane[point, vector]
Base point and normal defining a target plane.
- pointssequence[[float, float, float] |
- Returns:
- list[[float, float, float]]
XYZ coordinates of the oriented points.
Notes
This function is useful to orient a planar problem in the xy-plane to simplify the calculation (see example).
Examples
>>> from compas.geometry import Point >>> from compas.geometry import orient_points >>> from compas.geometry import intersection_segment_segment_xy
>>> refplane = ([0.57735, 0.57735, 0.57735], [1.0, 1.0, 1.0]) >>> tarplane = ([0.0, 0.0, 0.0], [0.0, 0.0, 1.0]) >>> points = [ [0.288675, 0.288675, 1.1547], [0.866025, 0.866025, 0.0], [1.077350, 0.077350, 0.57735], [0.077350, 1.077350, 0.57735] ]
>>> points = orient_points(points, refplane, tarplane) >>> ab = points[0], points[1] >>> cd = points[2], points[3] >>> point = intersection_segment_segment_xy(ab, cd) >>> points = orient_points([point], tarplane, refplane)
>>> Point(*points[0]) Point(0.577, 0.577, 0.577)