diff --git a/cadquery/cq.py b/cadquery/cq.py index da0bc02d4..f7ae9833e 100644 --- a/cadquery/cq.py +++ b/cadquery/cq.py @@ -202,7 +202,7 @@ def _collectProperty(self, propName: str) -> List[CQObject]: """ Collects all of the values for propName, for all items on the stack. - FreeCAD objects do not implement id correctly, + OCCT objects do not implement id correctly, so hashCode is used to ensure we don't add the same object multiple times. @@ -334,7 +334,7 @@ def vals(self) -> List[CQObject]: """ get the values in the current list - :rtype: list of FreeCAD objects + :rtype: list of occ_impl objects :returns: the values of the objects on the stack. Contrast with :py:meth:`all`, which returns CQ objects for all of the items on the stack @@ -403,10 +403,9 @@ def _getTagged(self, name: str) -> "Workplane": def toOCC(self) -> Any: """ - Directly returns the wrapped FreeCAD object to cut down on the amount of boiler plate code - needed when rendering a model in FreeCAD's 3D view. - :return: The wrapped FreeCAD object - :rtype A FreeCAD object or a SolidReference + Directly returns the wrapped OCCT object. + :return: The wrapped OCCT object + :rtype TopoDS_Shape or a subclass """ return self.val().wrapped @@ -1030,7 +1029,7 @@ def mirror( union: bool = False, ): """ - Mirror a single CQ object. This operation is the same as in the FreeCAD PartWB's mirroring + Mirror a single CQ object. :param mirrorPlane: the plane to mirror about :type mirrorPlane: string, one of "XY", "YX", "XZ", "ZX", "YZ", "ZY" the planes @@ -1967,9 +1966,6 @@ def mirrorY(self) -> "Workplane": s = Workplane().lineTo(2,2).threePointArc((3,1),(2,0)).mirrorX().extrude(0.25) Produces a flat, heart shaped object - - Future Enhancements: - mirrorX().mirrorY() should work but doesnt, due to some FreeCAD weirdness """ # convert edges to a wire, if there are pending edges n = self.wire(forConstruction=False) @@ -1996,9 +1992,6 @@ def mirrorX(self) -> "Workplane": and finally joined into a new wire Typically used to make creating wires with symmetry easier. - - Future Enhancements: - mirrorX().mirrorY() should work but doesnt, due to some FreeCAD weirdness """ # convert edges to a wire, if there are pending edges n = self.wire(forConstruction=False) @@ -2031,7 +2024,7 @@ def _addPendingWire(self, wire: Wire) -> None: """ Queue a Wire for later extrusion - Internal Processing Note. In FreeCAD, edges-->wires-->faces-->solids. + Internal Processing Note. In OCCT, edges-->wires-->faces-->solids. but users do not normally care about these distinctions. Users 'think' in terms of edges, and solids. @@ -2060,10 +2053,6 @@ def consolidateWires(self) -> "Workplane": Attempt to consolidate wires on the stack into a single. If possible, a new object with the results are returned. if not possible, the wires remain separated - - FreeCAD has a bug in Part.Wire([]) which does not create wires/edges properly sometimes - Additionally, it has a bug where a profile composed of two wires ( rather than one ) - also does not work properly. Together these are a real problem. """ w = self._consolidateWires() @@ -2785,7 +2774,7 @@ def revolve( # Make sure we account for users specifying angles larger than 360 degrees angleDegrees %= 360.0 - # Compensate for FreeCAD not assuming that a 0 degree revolve means a 360 degree revolve + # Compensate for OCCT not assuming that a 0 degree revolve means a 360 degree revolve angleDegrees = 360.0 if angleDegrees == 0 else angleDegrees # The default start point of the vector defining the axis of rotation will be the origin @@ -3142,7 +3131,7 @@ def _extrude( :param distance: distance to extrude :param boolean both: extrude in both directions symmetrically - :return: a FreeCAD solid, suitable for boolean operations. + :return: OCCT solid(s), suitable for boolean operations. This method is a utility method, primarily for plugin and internal use. It is the basis for cutBlind,extrude,cutThruAll, and all similar methods. @@ -3198,7 +3187,7 @@ def _revolve( :type axisStart: tuple, a two tuple :param axisEnd: the end point of the axis of rotation :type axisEnd: tuple, a two tuple - :return: a FreeCAD solid, suitable for boolean operations. + :return: a OCCT solid(s), suitable for boolean operations. This method is a utility method, primarily for plugin and internal use. """ diff --git a/cadquery/occ_impl/shapes.py b/cadquery/occ_impl/shapes.py index 93f1334e4..b9b330d3c 100644 --- a/cadquery/occ_impl/shapes.py +++ b/cadquery/occ_impl/shapes.py @@ -1498,7 +1498,7 @@ def combine( :param cls: :param listOfWires: :param tol: default 1e-9 - :return: Wire + :return: List[Wire] """ edges_in = TopTools_HSequenceOfShape() diff --git a/changes.md b/changes.md index bde56affe..84f630e99 100644 --- a/changes.md +++ b/changes.md @@ -10,6 +10,9 @@ Master ------ ### Breaking changes * `centerOption` default value changed from `CenterOfMass` to `ProjectedOrigin` #532 + * `Wire.combine` interface changed - now it returns `List[Wire]` #397 + * `Workplane.each` interface changed - callable of the `Callable[[Union[cadquery.occ_impl.geom.Vector, cadquery.occ_impl.geom.Location, cadquery.occ_impl.shapes.Shape]], cadquery.occ_impl.shapes.Shape]` type is required #391 + * `Workplane.eachpoint` interface changed - callable of the `Callable[[Union[cadquery.occ_impl.geom.Vector, cadquery.occ_impl.geom.Location, cadquery.occ_impl.shapes.Shape]], cadquery.occ_impl.shapes.Shape]` type is required #391 ## Other changes