From 2f13e0e88e4e08dd0c7dd262d366f39385968341 Mon Sep 17 00:00:00 2001 From: Roger Maitland Date: Thu, 3 Nov 2022 11:48:59 -0400 Subject: [PATCH] Renamed f_g and r_g to forward/reverse_transform --- docs/direct_api_classes.svg | 845 ++++++++++++++++++------------------ src/build123d/direct_api.py | 22 +- 2 files changed, 423 insertions(+), 444 deletions(-) diff --git a/docs/direct_api_classes.svg b/docs/direct_api_classes.svg index 396a49b..664aaf0 100644 --- a/docs/direct_api_classes.svg +++ b/docs/direct_api_classes.svg @@ -4,11 +4,11 @@ - + classes - + build123d.direct_api.Axis @@ -36,622 +36,605 @@ build123d.direct_api.BoundBox - -BoundBox - -center -wrapped -xlen -xmax -xmin -ylen -ymax -ymin -zlen -zmax -zmin - -add(obj: Union[tuple[float, float, float], Vector, BoundBox], tol: float): BoundBox -diagonal_length(): float -find_outside_box_2d(bb1: BoundBox, bb2): Optional[BoundBox] -is_inside(second_box: BoundBox): bool + +BoundBox + +center +wrapped +xlen +xmax +xmin +ylen +ymax +ymin +zlen +zmax +zmin + +add(obj: Union[tuple[float, float, float], Vector, BoundBox], tol: float): BoundBox +diagonal_length(): float +find_outside_box_2d(bb1: BoundBox, bb2): Optional[BoundBox] +is_inside(second_box: BoundBox): bool build123d.direct_api.Plane - -Plane - -XY -XZ -YX -YZ -ZX -ZY -back -bottom -f_g -f_g -front -lcs -lcs -left -origin -origin -r_g -r_g -right -top -wrapped -x_dir : NoneType -y_dir -z_dir - -contains(obj: Union[VectorLike, Axis], tolerance: float): bool -from_local_coords(obj: Union[tuple, Vector, Shape, BoundBox]) -rotated(rotate: VectorLike): Plane -set_origin2d(x, y) -to_gp_ax2(): gp_Ax2 -to_local_coords(obj: Union[VectorLike, Shape, BoundBox]) -to_location(): Location + +Plane + +XY +XZ +YX +YZ +ZX +ZY +back +bottom +forward_transform +front +left +local_coord_system +origin +origin +reverse_transform +right +top +wrapped +x_dir : NoneType +y_dir +z_dir + +contains(obj: Union[VectorLike, Axis], tolerance: float): bool +from_local_coords(obj: Union[tuple, Vector, Shape, BoundBox]) +rotated(rotate: VectorLike): Plane +set_origin2d(x, y) +to_gp_ax2(): gp_Ax2 +to_local_coords(obj: Union[VectorLike, Shape, BoundBox]) +to_location(): Location build123d.direct_api.BoundBox->build123d.direct_api.Plane - - -_origin + + +_origin build123d.direct_api.BoundBox->build123d.direct_api.Plane - - -origin + + +origin build123d.direct_api.Compound - -Compound - - -cut(): Compound -fuse(): Compound -get_type(obj_type: Union[Edge, Wire, Face, Solid]): list[Union[Edge, Wire, Face, Solid]] -intersect(): Compound -make_2d_text(cls: str, txt: float, fontsize: str, font: Optional[str], font_path: FontStyle, font_style: Halign, halign: Valign, valign: float, position_on_path: Union[Edge, Wire], text_path): -make_compound(cls: Iterable[Shape], list_of_shapes): Compound -make_text(cls: str, text: float, size: float, height: str, font: str, font_path: FontStyle, kind: Halign, halign: Valign, valign: Plane, position): Compound -remove(shape: Shape): Compound + +Compound + + +cut(): Compound +fuse(): Compound +get_type(obj_type: Union[Edge, Wire, Face, Solid]): list[Union[Edge, Wire, Face, Solid]] +intersect(): Compound +make_2d_text(cls: str, txt: float, fontsize: str, font: Optional[str], font_path: FontStyle, font_style: Halign, halign: Valign, valign: float, position_on_path: Union[Edge, Wire], text_path): +make_compound(cls: Iterable[Shape], list_of_shapes): Compound +make_text(cls: str, text: float, size: float, height: str, font: str, font_path: FontStyle, kind: Halign, halign: Valign, valign: Plane, position): Compound +remove(shape: Shape): Compound build123d.direct_api.Mixin3D - -Mixin3D - - -chamfer(length: float, length2: Optional[float], edge_list: Iterable[Edge]) -dprism(basis: Optional[Face], bounds: list[Union[Face, Wire]], depth: float, taper: float, up_to_face: Face, thru_all: bool, additive: bool): Solid -fillet(radius: float, edge_list: Iterable[Edge]) -is_inside(point: VectorLike, tolerance: float): bool -shell(face_list: Optional[Iterable[Face]], thickness: float, tolerance: float, kind: Kind): Solid + +Mixin3D + + +chamfer(length: float, length2: Optional[float], edge_list: Iterable[Edge]) +dprism(basis: Optional[Face], bounds: list[Union[Face, Wire]], depth: float, taper: float, up_to_face: Face, thru_all: bool, additive: bool): Solid +fillet(radius: float, edge_list: Iterable[Edge]) +is_inside(point: VectorLike, tolerance: float): bool +shell(face_list: Optional[Iterable[Face]], thickness: float, tolerance: float, kind: Kind): Solid build123d.direct_api.Compound->build123d.direct_api.Mixin3D - - + + build123d.direct_api.Shape - -Shape - -area -for_construction : bool -label : str -location -orientation -position -volume -wrapped - -bounding_box(tolerance: float): BoundBox -cast(cls: TopoDS_Shape, obj: bool, for_construction): Shape -clean(): Shape -combined_center(objects: CenterOf, center_of): Vector -compounds(): ShapeList['Compound'] -compute_mass(obj): float -copy(): Shape -cut(): Shape -distance(other: Shape): float -distances(): Iterator[float] -edges(): ShapeList['Edge'] -export_brep(f: Union[str, BytesIO]): bool -export_step(file_name: str): IFSelect_ReturnStatus -export_stl(file_name: str, tolerance: float, angular_tolerance: float, ascii_format: bool): bool -faces(): ShapeList['Face'] -faces_intersected_by_line(point: VectorLike, axis: VectorLike, tol: float, direction: Direction): ShapeList[Face] -find_intersection(point: VectorLike, direction: VectorLike): list[tuple[Vector, Vector]] -fix(): Shape -fuse(): Shape -geom_type(): Geoms -hash_code(): int -import_brep(cls: Union[str, BytesIO], f): Shape -intersect(): Shape -is_equal(other: Shape): bool -is_null(): bool -is_same(other: Shape): bool -is_valid(): bool -locate(loc: Location): Shape -located(loc: Location): Shape -max_fillet(edge_list: Iterable[Edge], tolerance, max_iterations: int): float -mesh(tolerance: float, angular_tolerance: float) -mirror(mirror_plane: Plane): Shape -move(loc: Location): Shape -moved(loc: Location): Shape -project_text(txt: str, fontsize: float, depth: float, path: Union[Wire, Edge], font: str, font_path: str, kind: FontStyle, valign: Valign, start: float): Compound -rotate(axis: Axis, angle: float): Shape -scale(factor: float): Shape -shape_type(): Shapes -shells(): ShapeList['Shell'] -solids(): ShapeList['Solid'] -split(): Shape -tessellate(tolerance: float, angular_tolerance: float): Tuple[list[Vector], list[Tuple[int, int, int]]] -to_vtk_poly_data(tolerance: float, angular_tolerance: float, normals: bool): vtkPolyData -transform_geometry(t_matrix: Matrix): Shape -transform_shape(t_matrix: Matrix): Shape -transformed(rotate: VectorLike, offset: VectorLike): Shape -translate(vector: VectorLike): Shape -vertices(): ShapeList['Vertex'] -wires(): ShapeList['Wire'] + +Shape + +area +for_construction : bool +label : str +location +orientation +position +volume +wrapped + +bounding_box(tolerance: float): BoundBox +cast(cls: TopoDS_Shape, obj: bool, for_construction): Shape +clean(): Shape +combined_center(objects: CenterOf, center_of): Vector +compounds(): ShapeList['Compound'] +compute_mass(obj): float +copy(): Shape +cut(): Shape +distance(other: Shape): float +distances(): Iterator[float] +edges(): ShapeList['Edge'] +export_brep(f: Union[str, BytesIO]): bool +export_step(file_name: str): IFSelect_ReturnStatus +export_stl(file_name: str, tolerance: float, angular_tolerance: float, ascii_format: bool): bool +faces(): ShapeList['Face'] +faces_intersected_by_line(point: VectorLike, axis: VectorLike, tol: float, direction: Direction): ShapeList[Face] +find_intersection(point: VectorLike, direction: VectorLike): list[tuple[Vector, Vector]] +fix(): Shape +fuse(): Shape +geom_type(): Geoms +hash_code(): int +import_brep(cls: Union[str, BytesIO], f): Shape +intersect(): Shape +is_equal(other: Shape): bool +is_null(): bool +is_same(other: Shape): bool +is_valid(): bool +locate(loc: Location): Shape +located(loc: Location): Shape +max_fillet(edge_list: Iterable[Edge], tolerance, max_iterations: int): float +mesh(tolerance: float, angular_tolerance: float) +mirror(mirror_plane: Plane): Shape +move(loc: Location): Shape +moved(loc: Location): Shape +project_text(txt: str, fontsize: float, depth: float, path: Union[Wire, Edge], font: str, font_path: str, kind: FontStyle, valign: Valign, start: float): Compound +rotate(axis: Axis, angle: float): Shape +scale(factor: float): Shape +shape_type(): Shapes +shells(): ShapeList['Shell'] +solids(): ShapeList['Solid'] +split(): Shape +tessellate(tolerance: float, angular_tolerance: float): Tuple[list[Vector], list[Tuple[int, int, int]]] +to_vtk_poly_data(tolerance: float, angular_tolerance: float, normals: bool): vtkPolyData +transform_geometry(t_matrix: Matrix): Shape +transform_shape(t_matrix: Matrix): Shape +transformed(rotate: VectorLike, offset: VectorLike): Shape +translate(vector: VectorLike): Shape +vertices(): ShapeList['Vertex'] +wires(): ShapeList['Wire'] build123d.direct_api.Compound->build123d.direct_api.Shape - - + + build123d.direct_api.Edge - -Edge - -arc_center - -close(): Union[Edge, Wire] -distribute_locations(count: int, start: float, stop: float, positions_only: bool): list[Location] -make_circle(cls: float, radius: Plane, plane: float, start_angle: float, end_angle: AngularDirection, angular_direction): Edge -make_ellipse(cls: float, x_radius: float, y_radius: Plane, plane: float, start_angle: float, end_angle: AngularDirection, angular_direction): Edge -make_line(cls: VectorLike, v1: VectorLike, v2): Edge -make_spline(cls: list[VectorLike], points: list[VectorLike], tangents: bool, periodic: list[float], parameters: bool, scale: float, tol): Edge -make_spline_approx(cls: list[VectorLike], points: float, tol: Tuple[float, float, float], smoothing: int, min_deg: int, max_deg): Edge -make_tangent_arc(cls: VectorLike, start: VectorLike, tangent: VectorLike, end): Edge -make_three_point_arc(cls: VectorLike, v1: VectorLike, v2: VectorLike, v3): Edge -project_to_shape(target_object: Shape, direction: VectorLike, center: VectorLike): list[Edge] -to_wire(): Wire + +Edge + +arc_center + +close(): Union[Edge, Wire] +distribute_locations(count: int, start: float, stop: float, positions_only: bool): list[Location] +make_circle(cls: float, radius: Plane, plane: float, start_angle: float, end_angle: AngularDirection, angular_direction): Edge +make_ellipse(cls: float, x_radius: float, y_radius: Plane, plane: float, start_angle: float, end_angle: AngularDirection, angular_direction): Edge +make_line(cls: VectorLike, v1: VectorLike, v2): Edge +make_spline(cls: list[VectorLike], points: list[VectorLike], tangents: bool, periodic: list[float], parameters: bool, scale: float, tol): Edge +make_spline_approx(cls: list[VectorLike], points: float, tol: Tuple[float, float, float], smoothing: int, min_deg: int, max_deg): Edge +make_tangent_arc(cls: VectorLike, start: VectorLike, tangent: VectorLike, end): Edge +make_three_point_arc(cls: VectorLike, v1: VectorLike, v2: VectorLike, v3): Edge +project_to_shape(target_object: Shape, direction: VectorLike, center: VectorLike): list[Edge] +to_wire(): Wire build123d.direct_api.Mixin1D - -Mixin1D - -center -center_of_mass -length -radius - -end_point(): Vector -is_closed(): bool -location_at(distance: float, position_mode: PositionMode, frame_method: FrameMethod, planar: bool): Location -locations(ds: Iterable[float], position_mode: PositionMode, frame_method: FrameMethod, planar: bool): list[Location] -normal(): Vector -param_at(distance: float): float -position_at(d: float, position_mode: PositionMode): Vector -positions(ds: Iterable[float], position_mode: PositionMode): list[Vector] -project(face: Face, d: VectorLike, closest: bool): Union[Mixin1D, list[Mixin1D]] -start_point(): Vector -tangent_at(location_param: float, position_mode: PositionMode): Vector + +Mixin1D + +center +center_of_mass +length +radius + +end_point(): Vector +is_closed(): bool +location_at(distance: float, position_mode: PositionMode, frame_method: FrameMethod, planar: bool): Location +locations(ds: Iterable[float], position_mode: PositionMode, frame_method: FrameMethod, planar: bool): list[Location] +normal(): Vector +param_at(distance: float): float +position_at(d: float, position_mode: PositionMode): Vector +positions(ds: Iterable[float], position_mode: PositionMode): list[Vector] +project(face: Face, d: VectorLike, closest: bool): Union[Mixin1D, list[Mixin1D]] +start_point(): Vector +tangent_at(location_param: float, position_mode: PositionMode): Vector build123d.direct_api.Edge->build123d.direct_api.Mixin1D - - + + build123d.direct_api.Edge->build123d.direct_api.Shape - - + + build123d.direct_api.Face - -Face - -center -center_of_geometry -center_of_mass - -chamfer_2d(d: float, vertices: Iterable[Vertex]): Face -construct_on(cls: Face, f: Wire, outer): Face -fillet_2d(radius: float, vertices: Iterable[Vertex]): Face -inner_wires(): list[Wire] -is_inside(point: VectorLike, tolerance: float): bool -make_from_wires(cls: Wire, outer_wire: list[Wire], inner_wires): Face -make_holes(interior_wires: list[Wire]): Face -make_plane(cls: Plane, plane): Face -make_rect(cls: float, width: float, height: VectorLike, pnt: VectorLike, normal): Face -make_ruled_surface(cls: Edge, edge1: Edge, edge2): Face -make_surface(cls: Union[Wire, list[Edge]], exterior: list[VectorLike], surface_points: list[Wire], interior_wires): Face -make_surface_from_curves(cls, curve1, curve2): Face -make_surface_from_points(cls: list[list[VectorLike]], points: float, tol: Tuple[float, float, float], smoothing: int, min_deg: int, max_deg): Face -normal_at(surface_point: VectorLike): Vector -outer_wire(): Wire -project(other: Face, d: VectorLike): Face -project_to_shape(target_object: Shape, direction: VectorLike, center: VectorLike, internal_face_points: list[Vector]): list[Face] -thicken(depth: float, direction: VectorLike): Solid -to_pln(): gp_Pln + +Face + +center +center_of_geometry +center_of_mass + +chamfer_2d(d: float, vertices: Iterable[Vertex]): Face +construct_on(cls: Face, f: Wire, outer): Face +fillet_2d(radius: float, vertices: Iterable[Vertex]): Face +inner_wires(): list[Wire] +is_inside(point: VectorLike, tolerance: float): bool +make_from_wires(cls: Wire, outer_wire: list[Wire], inner_wires): Face +make_holes(interior_wires: list[Wire]): Face +make_plane(cls: Plane, plane): Face +make_rect(cls: float, width: float, height: VectorLike, pnt: VectorLike, normal): Face +make_ruled_surface(cls: Edge, edge1: Edge, edge2): Face +make_surface(cls: Union[Wire, list[Edge]], exterior: list[VectorLike], surface_points: list[Wire], interior_wires): Face +make_surface_from_curves(cls, curve1, curve2): Face +make_surface_from_points(cls: list[list[VectorLike]], points: float, tol: Tuple[float, float, float], smoothing: int, min_deg: int, max_deg): Face +normal_at(surface_point: VectorLike): Vector +outer_wire(): Wire +project(other: Face, d: VectorLike): Face +project_to_shape(target_object: Shape, direction: VectorLike, center: VectorLike, internal_face_points: list[Vector]): list[Face] +thicken(depth: float, direction: VectorLike): Solid +to_pln(): gp_Pln build123d.direct_api.Face->build123d.direct_api.Shape - - + + build123d.direct_api.Location - -Location - -orientation -position -wrapped - -inverse(): Location -to_tuple(): tuple[tuple[float, float, float], tuple[float, float, float]] + +Location + +orientation +position +wrapped + +inverse(): Location +to_tuple(): tuple[tuple[float, float, float], tuple[float, float, float]] build123d.direct_api.Matrix - -Matrix - -wrapped : NoneType - -inverse(): Matrix -multiply(other: Vector): Vector -rotate_x(angle: float) -rotate_y(angle: float) -rotate_z(angle: float) -transposed_list(): Sequence[float] + +Matrix + +wrapped : NoneType + +inverse(): Matrix +multiply(other: Vector): Vector +rotate_x(angle: float) +rotate_y(angle: float) +rotate_z(angle: float) +transposed_list(): Sequence[float] build123d.direct_api.Matrix->build123d.direct_api.Plane - - -r_g + + +reverse_transform build123d.direct_api.Matrix->build123d.direct_api.Plane - - -f_g - - - -build123d.direct_api.Matrix->build123d.direct_api.Plane - - -r_g - - - -build123d.direct_api.Matrix->build123d.direct_api.Plane - - -f_g + + +forward_transform build123d.direct_api.Rotation - -Rotation - -about_x : float -about_y : float -about_z : float - - + +Rotation + +about_x : float +about_y : float +about_z : float + + build123d.direct_api.Rotation->build123d.direct_api.Location - - + + build123d.direct_api.ShapeList - -ShapeList - - -filter_by(filter_by: Union[Axis, GeomType], reverse: bool, tolerance: float): ShapeList -filter_by_position(axis: Axis, minimum: float, maximum: float, inclusive: tuple[bool, bool]) -group_by(group_by: Union[Axis, SortBy], reverse, tol_digits) -sort_by(sort_by: Union[Axis, SortBy], reverse: bool) + +ShapeList + + +filter_by(filter_by: Union[Axis, GeomType], reverse: bool, tolerance: float): ShapeList +filter_by_position(axis: Axis, minimum: float, maximum: float, inclusive: tuple[bool, bool]) +group_by(group_by: Union[Axis, SortBy], reverse, tol_digits) +sort_by(sort_by: Union[Axis, SortBy], reverse: bool) build123d.direct_api.Shell - -Shell - - -make_shell(cls: Iterable[Face], faces): Shell + +Shell + + +make_shell(cls: Iterable[Face], faces): Shell build123d.direct_api.Shell->build123d.direct_api.Shape - - + + build123d.direct_api.Solid - -Solid - -center -center_of_mass - -extrude_linear(cls: Union[Face, Wire], section: VectorLike, normal: list[Wire], inner_wires: float, taper): Solid -extrude_linear_with_rotation(cls: Union[Face, Wire], section: VectorLike, center: VectorLike, normal: float, angle: list[Wire], inner_wires): Solid -is_solid(obj): bool -make_box(cls: float, length: float, width: float, height: Plane, plane): Solid -make_cone(cls: float, base_radius: float, top_radius: float, height: Plane, plane: float, angle): Solid -make_cylinder(cls: float, radius: float, height: Plane, plane: float, angle): Solid -make_loft(cls: list[Wire], wires: bool, ruled): Solid -make_solid(cls: Shell, shell): Solid -make_sphere(cls: float, radius: Plane, plane: float, angle1: float, angle2: float, angle3): Shape -make_torus(cls: float, major_radius: float, minor_radius: Plane, plane: float, start_angle: float, end_angle): Solid -make_wedge(cls: float, dx: float, dy: float, dz: float, xmin: float, zmin: float, xmax: float, zmax: Plane, plane): Solid -revolve(cls: Union[Face, Wire], section: float, angle: Axis, axis: list[Wire], inner_wires): Solid -sweep(cls: Union[Face, Wire], section: Union[Wire, Edge], path: list[Wire], inner_wires: bool, make_solid: bool, is_frenet: Union[Vector, Wire, Edge, None], mode: Transition, transition): Solid -sweep_multi(cls: Iterable[Union[Wire, Face]], profiles: Union[Wire, Edge], path: bool, make_solid: bool, is_frenet: Union[Vector, Wire, Edge, None], mode): Solid + +Solid + +center +center_of_mass + +extrude_linear(cls: Union[Face, Wire], section: VectorLike, normal: list[Wire], inner_wires: float, taper): Solid +extrude_linear_with_rotation(cls: Union[Face, Wire], section: VectorLike, center: VectorLike, normal: float, angle: list[Wire], inner_wires): Solid +is_solid(obj): bool +make_box(cls: float, length: float, width: float, height: Plane, plane): Solid +make_cone(cls: float, base_radius: float, top_radius: float, height: Plane, plane: float, angle): Solid +make_cylinder(cls: float, radius: float, height: Plane, plane: float, angle): Solid +make_loft(cls: list[Wire], wires: bool, ruled): Solid +make_solid(cls: Shell, shell): Solid +make_sphere(cls: float, radius: Plane, plane: float, angle1: float, angle2: float, angle3): Shape +make_torus(cls: float, major_radius: float, minor_radius: Plane, plane: float, start_angle: float, end_angle): Solid +make_wedge(cls: float, dx: float, dy: float, dz: float, xmin: float, zmin: float, xmax: float, zmax: Plane, plane): Solid +revolve(cls: Union[Face, Wire], section: float, angle: Axis, axis: list[Wire], inner_wires): Solid +sweep(cls: Union[Face, Wire], section: Union[Wire, Edge], path: list[Wire], inner_wires: bool, make_solid: bool, is_frenet: Union[Vector, Wire, Edge, None], mode: Transition, transition): Solid +sweep_multi(cls: Iterable[Union[Wire, Face]], profiles: Union[Wire, Edge], path: bool, make_solid: bool, is_frenet: Union[Vector, Wire, Edge, None], mode): Solid build123d.direct_api.Solid->build123d.direct_api.Mixin3D - - + + build123d.direct_api.Solid->build123d.direct_api.Shape - - + + build123d.direct_api.Vector - -Vector - -X -X -Y -Y -Z -center -length -vector_index : int -wrapped - -add(vec: Vector): Vector -cross(vec: Vector): Vector -distance_to_line() -distance_to_plane() -dot(vec: Vector): float -get_angle(vec: Vector): float -get_signed_angle(vec: Vector, normal: Vector): float -multiply(scale: float): Vector -normalized(): Vector -project_to_line(line: Vector): Vector -project_to_plane(plane: Plane): Vector -rotate_x(angle: float): Vector -rotate_y(angle: float): Vector -rotate_z(angle: float): Vector -sub(vec: Vector): Vector -to_dir(): gp_Dir -to_pnt(): gp_Pnt -to_tuple(): tuple[float, float, float] -transform(affine_transform: Matrix): Vector + +Vector + +X +X +Y +Y +Z +center +length +vector_index : int +wrapped + +add(vec: Vector): Vector +cross(vec: Vector): Vector +distance_to_line() +distance_to_plane() +dot(vec: Vector): float +get_angle(vec: Vector): float +get_signed_angle(vec: Vector, normal: Vector): float +multiply(scale: float): Vector +normalized(): Vector +project_to_line(line: Vector): Vector +project_to_plane(plane: Plane): Vector +rotate_x(angle: float): Vector +rotate_y(angle: float): Vector +rotate_z(angle: float): Vector +sub(vec: Vector): Vector +to_dir(): gp_Dir +to_pnt(): gp_Pnt +to_tuple(): tuple[float, float, float] +transform(affine_transform: Matrix): Vector - + build123d.direct_api.Vector->build123d.direct_api.Axis - - + + position - + build123d.direct_api.Vector->build123d.direct_api.Axis - - + + direction + +build123d.direct_api.Vector->build123d.direct_api.Plane + + +_origin + + + +build123d.direct_api.Vector->build123d.direct_api.Plane + + +_origin + + build123d.direct_api.Vector->build123d.direct_api.Plane - - -_origin + + +_origin build123d.direct_api.Vector->build123d.direct_api.Plane - - -_origin + + +_origin build123d.direct_api.Vector->build123d.direct_api.Plane - - -_origin + + +_origin build123d.direct_api.Vector->build123d.direct_api.Plane - - -_origin + + +x_dir build123d.direct_api.Vector->build123d.direct_api.Plane - - -_origin + + +x_dir build123d.direct_api.Vector->build123d.direct_api.Plane - - -x_dir + + +x_dir build123d.direct_api.Vector->build123d.direct_api.Plane - - -x_dir + + +z_dir build123d.direct_api.Vector->build123d.direct_api.Plane - - -x_dir + + +z_dir build123d.direct_api.Vector->build123d.direct_api.Plane - - -z_dir + + +z_dir build123d.direct_api.Vector->build123d.direct_api.Plane - - -z_dir + + +z_dir build123d.direct_api.Vector->build123d.direct_api.Plane - - -z_dir + + +y_dir build123d.direct_api.Vector->build123d.direct_api.Plane - - -z_dir + + +y_dir build123d.direct_api.Vector->build123d.direct_api.Plane - - -y_dir - - - -build123d.direct_api.Vector->build123d.direct_api.Plane - - -y_dir - - - -build123d.direct_api.Vector->build123d.direct_api.Plane - - -origin + + +origin build123d.direct_api.Vertex - -Vertex - -X -Y -Z -center -wrapped - -to_tuple(): tuple[float, float, float] -to_vector(): Vector + +Vertex + +X +Y +Z +center +wrapped + +to_tuple(): tuple[float, float, float] +to_vector(): Vector build123d.direct_api.Vertex->build123d.direct_api.Shape - - + + build123d.direct_api.Wire - -Wire - - -chamfer_2d(d: float, vertices: Iterable[Vertex]): Wire -close(): Wire -combine(cls: Iterable[Union[Wire, Edge]], list_of_wires: float, tol): list[Wire] -fillet_2d(radius: float, vertices: Iterable[Vertex]): Wire -make_circle(cls: float, radius: Plane, plane): Wire -make_ellipse(cls: float, x_radius: float, y_radius: Plane, plane: float, start_angle: float, end_angle: AngularDirection, angular_direction: bool, closed): Wire -make_helix(cls: float, pitch: float, height: float, radius: VectorLike, center: VectorLike, normal: float, angle: bool, lefthand): Wire -make_polygon(cls: Iterable[VectorLike], vertices: bool, close): Wire -make_rect(cls: float, width: float, height: VectorLike, pnt: VectorLike, normal): Wire -make_wire(cls: Iterable[Edge], edges: bool, sequenced): Wire -offset_2d(d: float, kind: Kind): list[Wire] -project_to_shape(target_object: Shape, direction: VectorLike, center: VectorLike): list[Wire] -stitch(other: Wire): Wire -to_wire(): Wire + +Wire + + +chamfer_2d(d: float, vertices: Iterable[Vertex]): Wire +close(): Wire +combine(cls: Iterable[Union[Wire, Edge]], list_of_wires: float, tol): list[Wire] +fillet_2d(radius: float, vertices: Iterable[Vertex]): Wire +make_circle(cls: float, radius: Plane, plane): Wire +make_ellipse(cls: float, x_radius: float, y_radius: Plane, plane: float, start_angle: float, end_angle: AngularDirection, angular_direction: bool, closed): Wire +make_helix(cls: float, pitch: float, height: float, radius: VectorLike, center: VectorLike, normal: float, angle: bool, lefthand): Wire +make_polygon(cls: Iterable[VectorLike], vertices: bool, close): Wire +make_rect(cls: float, width: float, height: VectorLike, pnt: VectorLike, normal): Wire +make_wire(cls: Iterable[Edge], edges: bool, sequenced): Wire +offset_2d(d: float, kind: Kind): list[Wire] +project_to_shape(target_object: Shape, direction: VectorLike, center: VectorLike): list[Wire] +stitch(other: Wire): Wire +to_wire(): Wire build123d.direct_api.Wire->build123d.direct_api.Mixin1D - - + + build123d.direct_api.Wire->build123d.direct_api.Shape - - + + diff --git a/src/build123d/direct_api.py b/src/build123d/direct_api.py index ce61af0..36f784d 100644 --- a/src/build123d/direct_api.py +++ b/src/build123d/direct_api.py @@ -3083,7 +3083,7 @@ class Shape: ) projection_face = text_face.translate( (-face_center_x, 0, 0) - ).transform_shape(surface_normal_plane.r_g) + ).transform_shape(surface_normal_plane.reverse_transform) logging.debug("projecting face at %0.2f", relative_position_on_wire) projected_faces.append( projection_face.project_to_shape(self, surface_normal * -1)[0] @@ -3483,10 +3483,6 @@ class Plane: """ - lcs: gp_Ax3 - r_g: Matrix - f_g: Matrix - @classmethod @property def XY(cls) -> Plane: @@ -3609,7 +3605,7 @@ class Plane: ) self.origin = self._origin # set origin to calculate transformations - def _eq_iter(self, other:Plane): + def _eq_iter(self, other: Plane): """Iterator to successively test equality Args: @@ -3631,11 +3627,11 @@ class Plane: # x-axis vectors are parallel (assumption: both are unit vectors) yield abs(self.x_dir.dot(other.x_dir) - 1) < eq_tolerance_dot - def __eq__(self, other:Plane): + def __eq__(self, other: Plane): """Are planes equal""" return all(self._eq_iter(other)) - def __ne__(self, other:Plane): + def __ne__(self, other: Plane): """Are planes not equal""" return not self.__eq__(other) @@ -3767,9 +3763,9 @@ class Plane: inverse_t.SetTransformation(local_coord_system, global_coord_system) inverse.wrapped = gp_GTrsf(inverse_t) - self.lcs = local_coord_system - self.r_g = inverse - self.f_g = forward + self.local_coord_system: gp_Ax3 = local_coord_system + self.reverse_transform: Matrix = inverse + self.forward_transform: Matrix = forward def to_location(self) -> Location: """Return Location representing the origin and z direction""" @@ -3800,7 +3796,7 @@ class Plane: an object of the same type, but repositioned to local coordinates """ - transform_matrix = self.f_g if to else self.r_g + transform_matrix = self.forward_transform if to else self.reverse_transform if isinstance(obj, (tuple, Vector)): return_value = Vector(obj).transform(transform_matrix) @@ -3949,7 +3945,7 @@ class Compound(Shape, Mixin3D): vec_normal = text_flat.faces()[0].normal_at() * height text_3d = BRepPrimAPI_MakePrism(text_flat.wrapped, vec_normal.wrapped) - return_value = cls(text_3d.Shape()).transform_shape(position.r_g) + return_value = cls(text_3d.Shape()).transform_shape(position.reverse_transform) return return_value