mirror of
https://github.com/gumyr/build123d.git
synced 2025-12-06 02:30:55 -08:00
additional typing fixes for objects_sketch.py
This commit is contained in:
parent
d05b98aff7
commit
7e65b8e930
2 changed files with 23 additions and 79 deletions
|
|
@ -1,8 +1,5 @@
|
|||
src/build123d/_dev/scm_version.py:0: error: Cannot find implementation or library stub for module named "setuptools_scm" [import-not-found]
|
||||
src/build123d/_dev/scm_version.py:0: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
|
||||
src/build123d/version.py:0: error: Cannot find implementation or library stub for module named "build123d._version" [import-not-found]
|
||||
src/build123d/version.py:0: error: Name "version" already defined (possibly by an import) [no-redef]
|
||||
src/build123d/jupyter_tools.py:0: error: Cannot find implementation or library stub for module named "IPython.display" [import-not-found]
|
||||
src/build123d/geometry.py:0: error: Incompatible default for argument "normal" (default has type "None", argument has type "Vector") [assignment]
|
||||
src/build123d/geometry.py:0: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
|
||||
src/build123d/geometry.py:0: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
|
||||
|
|
@ -56,9 +53,10 @@ src/build123d/geometry.py:0: error: Incompatible types in assignment (expression
|
|||
src/build123d/geometry.py:0: error: Item "Sequence[float]" of "Any | Sequence[float]" has no attribute "transform_shape" [union-attr]
|
||||
src/build123d/geometry.py:0: error: Name "Shape" is not defined [name-defined]
|
||||
src/build123d/topology/shape_core.py:0: error: Incompatible return value type (got "Any | None", expected "Shape[Any]") [return-value]
|
||||
src/build123d/topology/shape_core.py:0: error: "PrettyPrinter" has no attribute "pretty" [attr-defined]
|
||||
src/build123d/persistence.py:0: error: Incompatible return value type (got "None", expected "bytes") [return-value]
|
||||
src/build123d/persistence.py:0: error: Incompatible return value type (got "None", expected "bytes") [return-value]
|
||||
src/build123d/mesher.py:0: error: Cannot find implementation or library stub for module named "py_lib3mf" [import-not-found]
|
||||
src/build123d/mesher.py:0: error: Skipping analyzing "py_lib3mf": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/build123d/mesher.py:0: error: Item "None" of "Any | None" has no attribute "Orientation" [union-attr]
|
||||
src/build123d/mesher.py:0: error: "list" expects 1 type argument, but 3 given [type-arg]
|
||||
src/build123d/mesher.py:0: error: Incompatible types in assignment (expression has type "Array[c_uint]", variable has type "Array[c_float]") [assignment]
|
||||
|
|
@ -68,7 +66,7 @@ src/build123d/mesher.py:0: note: Use https://github.com/hauntsaninja/no_implicit
|
|||
src/build123d/mesher.py:0: error: Module "uuid" is not valid as a type [valid-type]
|
||||
src/build123d/mesher.py:0: note: Perhaps you meant to use a protocol matching the module structure?
|
||||
src/build123d/mesher.py:0: error: Attribute "meshes" already defined on line 0 [no-redef]
|
||||
src/build123d/importers.py:0: error: Cannot find implementation or library stub for module named "ocpsvg" [import-not-found]
|
||||
src/build123d/importers.py:0: error: Skipping analyzing "ocpsvg": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/build123d/importers.py:0: error: If x = b'abc' then f"{x}" or "{}".format(x) produces "b'abc'", not "abc". If this is desired behavior, use f"{x!r}" or "{!r}".format(x). Otherwise, decode the bytes [str-bytes-safe]
|
||||
src/build123d/importers.py:0: error: Incompatible types in assignment (expression has type "None", variable has type "bool") [assignment]
|
||||
src/build123d/build_common.py:0: error: Item "None" of "FrameType | None" has no attribute "f_code" [union-attr]
|
||||
|
|
@ -119,23 +117,17 @@ src/build123d/build_common.py:0: error: Incompatible return value type (got "_Wr
|
|||
src/build123d/build_common.py:0: note: "_Wrapped[[Builder, **P], T2, [Select], Any].__call__" has type "Callable[[DefaultArg(Select, 'select')], Any]"
|
||||
src/build123d/exporters3d.py:0: error: Unsupported left operand type for * ("None") [operator]
|
||||
src/build123d/exporters3d.py:0: note: Left operand is of type "Location | None"
|
||||
src/build123d/exporters.py:0: error: Cannot find implementation or library stub for module named "ezdxf" [import-not-found]
|
||||
src/build123d/exporters.py:0: error: Cannot find implementation or library stub for module named "ezdxf.colors" [import-not-found]
|
||||
src/build123d/exporters.py:0: error: Cannot find implementation or library stub for module named "ezdxf.math" [import-not-found]
|
||||
src/build123d/exporters.py:0: error: Incompatible default for argument "look_at" (default has type "None", argument has type "Vector | tuple[float, float] | tuple[float, float, float] | Sequence[float]") [assignment]
|
||||
src/build123d/exporters.py:0: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
|
||||
src/build123d/exporters.py:0: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
|
||||
src/build123d/exporters.py:0: error: Incompatible types in assignment (expression has type "int", target has type "str") [assignment]
|
||||
src/build123d/exporters.py:0: error: Incompatible types in assignment (expression has type "int", target has type "str") [assignment]
|
||||
src/build123d/exporters.py:0: error: Argument 2 to "add" of "LayerTable" has incompatible type "**dict[str, str]"; expected "int" [arg-type]
|
||||
src/build123d/exporters.py:0: error: Argument 2 to "add" of "LayerTable" has incompatible type "**dict[str, str]"; expected "int | None" [arg-type]
|
||||
src/build123d/exporters.py:0: error: Argument 2 to "add" of "LayerTable" has incompatible type "**dict[str, str]"; expected "bool" [arg-type]
|
||||
src/build123d/exporters.py:0: error: Argument 2 to "add" of "LayerTable" has incompatible type "**dict[str, str]"; expected "float | None" [arg-type]
|
||||
src/build123d/exporters.py:0: error: "None" object is not iterable [misc]
|
||||
src/build123d/exporters.py:0: error: Item "None" of "Location | None" has no attribute "wrapped" [union-attr]
|
||||
src/build123d/exporters.py:0: error: No overload variant of "Color" matches argument types "Any", "int" [call-overload]
|
||||
src/build123d/exporters.py:0: note: Possible overload variants:
|
||||
src/build123d/exporters.py:0: note: def __init__(self, q_color: Any) -> Color
|
||||
src/build123d/exporters.py:0: note: def __init__(self, name: str, alpha: float = ...) -> Color
|
||||
src/build123d/exporters.py:0: note: def __init__(self, red: float, green: float, blue: float, alpha: float = ...) -> Color
|
||||
src/build123d/exporters.py:0: note: def __init__(self, color_tuple: tuple[float]) -> Color
|
||||
src/build123d/exporters.py:0: note: def __init__(self, color_code: int, alpha: int = ...) -> Color
|
||||
src/build123d/exporters.py:0: error: Incompatible types in assignment (expression has type "None", variable has type "BoundBox") [assignment]
|
||||
src/build123d/exporters.py:0: error: Incompatible types in assignment (expression has type "_Layer", variable has type "str") [assignment]
|
||||
src/build123d/exporters.py:0: error: Argument 2 to "_add_single_shape" of "ExportSVG" has incompatible type "str"; expected "_Layer" [arg-type]
|
||||
|
|
@ -240,56 +232,11 @@ src/build123d/operations_part.py:0: note: Use https://github.com/hauntsaninja/no
|
|||
src/build123d/operations_part.py:0: error: Unsupported operand types for * ("Sequence[float]" and "int") [operator]
|
||||
src/build123d/operations_part.py:0: note: Left operand is of type "Vector | Sequence[float]"
|
||||
src/build123d/operations_part.py:0: error: Argument "normal_override" to "thicken" of "Solid" has incompatible type "Vector | int"; expected "Vector | tuple[float, float] | tuple[float, float, float] | Sequence[float] | None" [arg-type]
|
||||
src/build123d/objects_sketch.py:0: error: Cannot find implementation or library stub for module named "trianglesolver" [import-not-found]
|
||||
src/build123d/objects_sketch.py:0: error: Incompatible default for argument "align" (default has type "None", argument has type "Align | tuple[Align, Align]") [assignment]
|
||||
src/build123d/objects_sketch.py:0: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
|
||||
src/build123d/objects_sketch.py:0: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
|
||||
src/build123d/objects_sketch.py:0: error: Incompatible types in assignment (expression has type "tuple[Any, ...] | None", variable has type "Align | tuple[Align, Align]") [assignment]
|
||||
src/build123d/objects_sketch.py:0: error: Argument 3 to "__init__" of "BaseSketchObject" has incompatible type "tuple[Any, ...] | None"; expected "Align | tuple[Align, Align]" [arg-type]
|
||||
src/build123d/objects_sketch.py:0: error: Argument 3 to "__init__" of "BaseSketchObject" has incompatible type "tuple[Any, ...] | None"; expected "Align | tuple[Align, Align]" [arg-type]
|
||||
src/build123d/objects_sketch.py:0: error: Incompatible types in assignment (expression has type "list[Any]", variable has type "tuple[Vector | tuple[float, float] | tuple[float, float, float] | Sequence[float] | Iterable[Vector | tuple[float, float] | tuple[float, float, float] | Sequence[float]], ...]") [assignment]
|
||||
src/build123d/objects_sketch.py:0: error: Argument 3 to "__init__" of "BaseSketchObject" has incompatible type "tuple[Any, ...] | None"; expected "Align | tuple[Align, Align]" [arg-type]
|
||||
src/build123d/objects_sketch.py:0: error: Argument 3 to "__init__" of "BaseSketchObject" has incompatible type "tuple[Any, ...] | None"; expected "Align | tuple[Align, Align]" [arg-type]
|
||||
src/build123d/objects_sketch.py:0: error: Incompatible types in assignment (expression has type "list[Vector]", variable has type "ShapeList[Vector]") [assignment]
|
||||
src/build123d/objects_sketch.py:0: error: Argument "align" to "__init__" of "BaseSketchObject" has incompatible type "None"; expected "Align | tuple[Align, Align]" [arg-type]
|
||||
src/build123d/objects_sketch.py:0: error: Argument 3 to "__init__" of "BaseSketchObject" has incompatible type "None"; expected "Align | tuple[Align, Align]" [arg-type]
|
||||
src/build123d/objects_sketch.py:0: error: Argument 3 to "__init__" of "BaseSketchObject" has incompatible type "None"; expected "Align | tuple[Align, Align]" [arg-type]
|
||||
src/build123d/objects_sketch.py:0: error: Argument 3 to "__init__" of "BaseSketchObject" has incompatible type "None"; expected "Align | tuple[Align, Align]" [arg-type]
|
||||
src/build123d/objects_sketch.py:0: error: Incompatible types in assignment (expression has type "Face | None", variable has type "Face") [assignment]
|
||||
src/build123d/objects_sketch.py:0: error: The return type of "__init__" must be None [misc]
|
||||
src/build123d/objects_sketch.py:0: error: Missing return statement [return]
|
||||
src/build123d/objects_sketch.py:0: error: Incompatible default for argument "font_path" (default has type "None", argument has type "str") [assignment]
|
||||
src/build123d/objects_sketch.py:0: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
|
||||
src/build123d/objects_sketch.py:0: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
|
||||
src/build123d/objects_sketch.py:0: error: Incompatible default for argument "path" (default has type "None", argument has type "Edge | Wire") [assignment]
|
||||
src/build123d/objects_sketch.py:0: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
|
||||
src/build123d/objects_sketch.py:0: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
|
||||
src/build123d/objects_sketch.py:0: error: Argument "align" to "make_text" of "Compound" has incompatible type "tuple[Any, ...] | None"; expected "Align | tuple[Align, Align]" [arg-type]
|
||||
src/build123d/objects_sketch.py:0: error: Argument 3 to "__init__" of "BaseSketchObject" has incompatible type "None"; expected "Align | tuple[Align, Align]" [arg-type]
|
||||
src/build123d/objects_sketch.py:0: error: Incompatible default for argument "right_side_angle" (default has type "None", argument has type "float") [assignment]
|
||||
src/build123d/objects_sketch.py:0: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
|
||||
src/build123d/objects_sketch.py:0: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
|
||||
src/build123d/objects_sketch.py:0: error: Argument 3 to "__init__" of "BaseSketchObject" has incompatible type "tuple[Any, ...] | None"; expected "Align | tuple[Align, Align]" [arg-type]
|
||||
src/build123d/objects_sketch.py:0: error: Incompatible default for argument "a" (default has type "None", argument has type "float") [assignment]
|
||||
src/build123d/objects_sketch.py:0: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
|
||||
src/build123d/objects_sketch.py:0: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
|
||||
src/build123d/objects_sketch.py:0: error: Incompatible default for argument "b" (default has type "None", argument has type "float") [assignment]
|
||||
src/build123d/objects_sketch.py:0: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
|
||||
src/build123d/objects_sketch.py:0: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
|
||||
src/build123d/objects_sketch.py:0: error: Incompatible default for argument "c" (default has type "None", argument has type "float") [assignment]
|
||||
src/build123d/objects_sketch.py:0: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
|
||||
src/build123d/objects_sketch.py:0: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
|
||||
src/build123d/objects_sketch.py:0: error: Incompatible default for argument "A" (default has type "None", argument has type "float") [assignment]
|
||||
src/build123d/objects_sketch.py:0: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
|
||||
src/build123d/objects_sketch.py:0: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
|
||||
src/build123d/objects_sketch.py:0: error: Incompatible default for argument "B" (default has type "None", argument has type "float") [assignment]
|
||||
src/build123d/objects_sketch.py:0: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
|
||||
src/build123d/objects_sketch.py:0: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
|
||||
src/build123d/objects_sketch.py:0: error: Incompatible default for argument "C" (default has type "None", argument has type "float") [assignment]
|
||||
src/build123d/objects_sketch.py:0: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
|
||||
src/build123d/objects_sketch.py:0: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
|
||||
src/build123d/objects_sketch.py:0: error: Item "None" of "Compound | Face | None" has no attribute "move" [union-attr]
|
||||
src/build123d/objects_sketch.py:0: error: Item "None" of "Compound | Face | None" has no attribute "bounding_box" [union-attr]
|
||||
src/build123d/objects_sketch.py:0: error: Item "None" of "Compound | Face | None" has no attribute "moved" [union-attr]
|
||||
src/build123d/objects_sketch.py:0: error: Argument "align" to "make_text" of "Compound" has incompatible type "Align | tuple[Align, Align] | None"; expected "Align | tuple[Align, Align]" [arg-type]
|
||||
src/build123d/objects_sketch.py:0: error: Generator has incompatible item type "Vector"; expected "bool" [misc]
|
||||
src/build123d/objects_sketch.py:0: error: Argument "align" to "__init__" of "BaseSketchObject" has incompatible type "tuple[Any, ...] | None"; expected "Align | tuple[Align, Align]" [arg-type]
|
||||
src/build123d/objects_part.py:0: error: Incompatible default for argument "align" (default has type "None", argument has type "Align | tuple[Align, Align, Align]") [assignment]
|
||||
src/build123d/objects_part.py:0: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
|
||||
src/build123d/objects_part.py:0: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
|
||||
|
|
@ -672,10 +619,7 @@ src/build123d/operations_generic.py:0: note: PEP 484 prohibits implicit Optional
|
|||
src/build123d/operations_generic.py:0: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
|
||||
src/build123d/operations_generic.py:0: error: Need type annotation for "edge_list" (hint: "edge_list: list[<type>] = ...") [var-annotated]
|
||||
src/build123d/operations_generic.py:0: error: Need type annotation for "new_faces" (hint: "new_faces: list[<type>] = ...") [var-annotated]
|
||||
src/build123d/drafting.py:0: error: Argument "align" to "Polygon" has incompatible type "None"; expected "Align | tuple[Align, Align]" [arg-type]
|
||||
src/build123d/drafting.py:0: error: Argument "align" to "__init__" of "BaseSketchObject" has incompatible type "None"; expected "Align | tuple[Align, Align]" [arg-type]
|
||||
src/build123d/drafting.py:0: error: Item "ShapeList[ArrowHead]" of "ArrowHead | ShapeList[ArrowHead]" has no attribute "clean" [union-attr]
|
||||
src/build123d/drafting.py:0: error: Argument "align" to "__init__" of "BaseSketchObject" has incompatible type "None"; expected "Align | tuple[Align, Align]" [arg-type]
|
||||
src/build123d/drafting.py:0: error: Incompatible default for argument "tolerance" (default has type "None", argument has type "float | tuple[float, float]") [assignment]
|
||||
src/build123d/drafting.py:0: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
|
||||
src/build123d/drafting.py:0: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
|
||||
|
|
@ -700,7 +644,6 @@ src/build123d/drafting.py:0: error: Item "ShapeList[Compound]" of "Compound | Sh
|
|||
src/build123d/drafting.py:0: error: Incompatible types in assignment (expression has type "list[tuple[Compound, float]]", variable has type "dict[Compound, float]") [assignment]
|
||||
src/build123d/drafting.py:0: error: Value of type "float" is not indexable [index]
|
||||
src/build123d/drafting.py:0: error: Invalid index type "int" for "dict[Compound, float]"; expected type "Compound" [index]
|
||||
src/build123d/drafting.py:0: error: Argument "align" to "__init__" of "BaseSketchObject" has incompatible type "None"; expected "Align | tuple[Align, Align]" [arg-type]
|
||||
src/build123d/drafting.py:0: error: Incompatible default for argument "sketch" (default has type "None", argument has type "Sketch") [assignment]
|
||||
src/build123d/drafting.py:0: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
|
||||
src/build123d/drafting.py:0: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
|
||||
|
|
@ -718,7 +661,6 @@ src/build123d/drafting.py:0: note: PEP 484 prohibits implicit Optional. Accordin
|
|||
src/build123d/drafting.py:0: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
|
||||
src/build123d/drafting.py:0: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]
|
||||
src/build123d/drafting.py:0: error: Argument 1 to "make_text" of "Compound" has incompatible type "int"; expected "str" [arg-type]
|
||||
src/build123d/drafting.py:0: error: Argument "align" to "__init__" of "BaseSketchObject" has incompatible type "None"; expected "Align | tuple[Align, Align]" [arg-type]
|
||||
src/build123d/__init__.py:0: error: Incompatible import of "copy" (imported name has type Module, local name has type "Callable[[_T], _T]") [assignment]
|
||||
src/build123d/__init__.py:0: error: Incompatible import of "copy" (imported name has type Module, local name has type "Callable[[_T], _T]") [assignment]
|
||||
src/build123d/__init__.py:0: error: Incompatible import of "copy" (imported name has type Module, local name has type "Callable[[_T], _T]") [assignment]
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class BaseSketchObject(Sketch):
|
|||
|
||||
def __init__(
|
||||
self,
|
||||
obj: Compound | Face,
|
||||
obj: Compound | Face | None,
|
||||
rotation: float = 0,
|
||||
align: Align | tuple[Align, Align] | None = None,
|
||||
mode: Mode = Mode.ADD,
|
||||
|
|
@ -202,8 +202,8 @@ class Polygon(BaseSketchObject):
|
|||
context = BuildSketch._get_context(self)
|
||||
validate_inputs(context, self)
|
||||
|
||||
pts = flatten_sequence(*pts)
|
||||
self.pts = pts
|
||||
flattened_pts = flatten_sequence(*pts)
|
||||
self.pts = flattened_pts
|
||||
self.align = tuplify(align, 2)
|
||||
|
||||
poly_pts = [Vector(p) for p in pts]
|
||||
|
|
@ -354,9 +354,9 @@ class RegularPolygon(BaseSketchObject):
|
|||
maxs = [pts_sorted[0][-1].X, pts_sorted[1][-1].Y]
|
||||
|
||||
align_offset = to_align_offset(mins, maxs, align, center=(0, 0))
|
||||
pts = [point + align_offset for point in pts]
|
||||
pts_ao = [point + align_offset for point in pts]
|
||||
|
||||
face = Face(Wire.make_polygon(pts))
|
||||
face = Face(Wire.make_polygon(pts_ao))
|
||||
super().__init__(face, rotation=0, align=None, mode=mode)
|
||||
|
||||
|
||||
|
|
@ -525,7 +525,7 @@ class SlotOverall(BaseSketchObject):
|
|||
self.slot_height = height
|
||||
|
||||
if width != height:
|
||||
face = Face(
|
||||
face: Face | None = Face(
|
||||
Wire(
|
||||
[
|
||||
Edge.make_line(Vector(-width / 2 + height / 2, 0, 0), Vector()),
|
||||
|
|
@ -569,9 +569,9 @@ class Text(BaseSketchObject):
|
|||
font_path: str | None = None,
|
||||
font_style: FontStyle = FontStyle.REGULAR,
|
||||
align: Align | tuple[Align, Align] | None = (Align.CENTER, Align.CENTER),
|
||||
path: Edge | Wire = None,
|
||||
path: Edge | Wire | None = None,
|
||||
position_on_path: float = 0.0,
|
||||
rotation: float = 0,
|
||||
rotation: float = 0.0,
|
||||
mode: Mode = Mode.ADD,
|
||||
):
|
||||
context = BuildSketch._get_context(self)
|
||||
|
|
@ -594,7 +594,7 @@ class Text(BaseSketchObject):
|
|||
font=font,
|
||||
font_path=font_path,
|
||||
font_style=font_style,
|
||||
align=tuplify(align, 2),
|
||||
align=align,
|
||||
position_on_path=position_on_path,
|
||||
text_path=path,
|
||||
)
|
||||
|
|
@ -741,7 +741,9 @@ class Triangle(BaseSketchObject):
|
|||
[Vector(0, 0), Vector(ar, 0), Vector(cr, 0).rotate(Axis.Z, self.B)]
|
||||
)
|
||||
)
|
||||
center_of_geometry = sum(Vector(v) for v in triangle.vertices()) / 3
|
||||
center_of_geometry = (
|
||||
sum((Vector(v) for v in triangle.vertices()), Vector(0, 0, 0)) / 3
|
||||
)
|
||||
triangle.move(Location(-center_of_geometry))
|
||||
alignment = None if align is None else tuplify(align, 2)
|
||||
super().__init__(obj=triangle, rotation=rotation, align=alignment, mode=mode)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue