diff --git a/Libs/cadquery/README.md b/Libs/cadquery/README.md index 5d20dfa..3939307 100644 --- a/Libs/cadquery/README.md +++ b/Libs/cadquery/README.md @@ -7,7 +7,7 @@ What is a CadQuery? [![Travis Build Status](https://travis-ci.org/dcowden/cadquery.svg?branch=master)](https://travis-ci.org/dcowden/cadquery?branch=master) [![Coverage Status](https://coveralls.io/repos/github/dcowden/cadquery/badge.svg?branch=master)](https://coveralls.io/github/dcowden/cadquery?branch=master) -[![GitHub version](https://badge.fury.io/gh/dcowden%2Fcadquery.svg)](https://github.com/dcowden/cadquery/releases/tag/v0.3.0) +[![GitHub version](https://d25lcipzij17d.cloudfront.net/badge.svg?id=gh&type=6&v=1.1.0&x2=0)](https://github.com/dcowden/cadquery/releases/tag/v1.1.0) [![License](https://img.shields.io/badge/license-Apache2-blue.svg)](https://github.com/dcowden/cadquery/blob/master/LICENSE) CadQuery is an intuitive, easy-to-use python based language for building parametric 3D CAD models. CadQuery is for 3D CAD what jQuery is for javascript. Imagine selecting Faces of a 3d object the same way you select DOM objects with JQuery! diff --git a/Libs/cadquery/cadquery/__init__.py b/Libs/cadquery/cadquery/__init__.py index a4bac34..efa7495 100644 --- a/Libs/cadquery/cadquery/__init__.py +++ b/Libs/cadquery/cadquery/__init__.py @@ -18,4 +18,4 @@ __all__ = [ 'TypeSelector','DirectionMinMaxSelector','StringSyntaxSelector','Selector','plugins', ] -__version__ = "1.0.0" +__version__ = "1.1.0" diff --git a/Libs/cadquery/cadquery/freecad_impl/shapes.py b/Libs/cadquery/cadquery/freecad_impl/shapes.py index 3cb88af..a047a5f 100644 --- a/Libs/cadquery/cadquery/freecad_impl/shapes.py +++ b/Libs/cadquery/cadquery/freecad_impl/shapes.py @@ -660,17 +660,17 @@ class Face(Shape): def cut(self, faceToCut): "Remove a face from another one" - return Shape.cast(self.obj.cut(faceToCut.obj)) + return Shape.cast(self.wrapped.cut(faceToCut.wrapped)) def fuse(self, faceToJoin): - return Shape.cast(self.obj.fuse(faceToJoin.obj)) + return Shape.cast(self.wrapped.fuse(faceToJoin.wrapped)) def intersect(self, faceToIntersect): """ computes the intersection between the face and the supplied one. The result could be a face or a compound of faces """ - return Shape.cast(self.obj.common(faceToIntersect.obj)) + return Shape.cast(self.wrapped.common(faceToIntersect.wrapped)) class Shell(Shape): @@ -751,18 +751,6 @@ class Solid(Shape): """ return Shape.cast(FreeCADPart.makeTorus(radius1, radius2, pnt, dir, angleDegrees1, angleDegrees2)) - @classmethod - def sweep(cls, profileWire, pathWire): - """ - make a solid by sweeping the profileWire along the specified path - :param cls: - :param profileWire: - :param pathWire: - :return: - """ - # needs to use freecad wire.makePipe or makePipeShell - # needs to allow free-space wires ( those not made from a workplane ) - @classmethod def makeLoft(cls, listOfWire, ruled=False): """ diff --git a/Libs/cadquery/changes.md b/Libs/cadquery/changes.md index d387b8a..475113c 100644 --- a/Libs/cadquery/changes.md +++ b/Libs/cadquery/changes.md @@ -2,7 +2,7 @@ Changes ======= -v1.1.0 (Unreleased) +v1.1.0 ------ * Fixes and addition of graphical examples for selectors (thanks @adam-urbanczyk) #181 * Added intersect operation (thanks @fragmuffin) #189 @@ -18,6 +18,11 @@ v1.1.0 (Unreleased) * Fixed Line versus LineSegment incompatibility between FreeCAD 0.16 and 0.17 #209 * @RustyVermeer fixed a long-standing bug with the extrusion of invalid faces #210 * @adam-urbanczyk fixed a Python 2 versus Python 3 (unicode) issue with SVG export #215 + * Python 3 support was completed by the community with @adam-urbanczyk leading the way + * SVG export improvements including orientation control from @RustyVermeer #232 + * Improved test coverage + * @galou fixed braille example #229 + v1.0.0 ------ diff --git a/Libs/cadquery/doc/conf.py b/Libs/cadquery/doc/conf.py index eeb824b..80974b1 100644 --- a/Libs/cadquery/doc/conf.py +++ b/Libs/cadquery/doc/conf.py @@ -55,9 +55,9 @@ copyright = 'Parametric Products Intellectual Holdings LLC, All Rights Reserved' # built documents. # # The short X.Y version. -version = '1.0' +version = '1.1' # The full version, including alpha/beta/rc tags. -release = '1.0.0' +release = '1.1.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/Libs/cadquery/setup.py b/Libs/cadquery/setup.py index 88fa5b2..790980e 100644 --- a/Libs/cadquery/setup.py +++ b/Libs/cadquery/setup.py @@ -16,7 +16,7 @@ from setuptools import setup #if we are building in travis, use the build number as the sub-minor version -version = '1.0.0' +version = '1.1.0' if 'TRAVIS_TAG' in list(os.environ.keys()): version= os.environ['TRAVIS_TAG'] diff --git a/Libs/cadquery/tests/TestCadObjects.py b/Libs/cadquery/tests/TestCadObjects.py index 65520de..d2ccbbb 100644 --- a/Libs/cadquery/tests/TestCadObjects.py +++ b/Libs/cadquery/tests/TestCadObjects.py @@ -402,6 +402,84 @@ class TestCadObjects(BaseTest): self.assertEquals(surf1.ShapeType(), 'Face') self.assertTrue(surf1.isValid()) + def testCut(self): + """ + Tests cutting one face from another. + """ + # Face 1 + edge1 = Part.makeLine((0, 0, 0), (0, 10, 0)) + edge2 = Part.makeLine((0, 10, 0), (10, 10, 0)) + edge3 = Part.makeLine((10, 10, 0), (10, 0, 0)) + edge4 = Part.makeLine((10, 0, 0), (0, 0, 0)) + wire1 = Part.Wire([edge1,edge2,edge3,edge4]) + face1 = Part.Face(wire1) + cqFace1 = Face(face1) + + # Face 2 (face to cut out of face 1) + edge1 = Part.makeLine((0, 0, 0), (0, 5, 0)) + edge2 = Part.makeLine((0, 5, 0), (5, 5, 0)) + edge3 = Part.makeLine((5, 5, 0), (5, 0, 0)) + edge4 = Part.makeLine((5, 0, 0), (0, 0, 0)) + wire1 = Part.Wire([edge1,edge2,edge3,edge4]) + face2 = Part.Face(wire1) + cqFace2 = Face(face2) + + # Face resulting from cut + cqFace3 = cqFace1.cut(cqFace2) + + self.assertEquals(len(cqFace3.Faces()), 1) + self.assertEquals(len(cqFace3.Edges()), 6) + + def testFuse(self): + """ + Tests fusing one face to another. + """ + # Face 1 + edge1 = Part.makeLine((0, 0, 0), (0, 10, 0)) + edge2 = Part.makeLine((0, 10, 0), (10, 10, 0)) + edge3 = Part.makeLine((10, 10, 0), (10, 0, 0)) + edge4 = Part.makeLine((10, 0, 0), (0, 0, 0)) + wire1 = Part.Wire([edge1,edge2,edge3,edge4]) + face1 = Part.Face(wire1) + cqFace1 = Face(face1) + + # Face 2 (face to cut out of face 1) + edge1 = Part.makeCircle(4.0) + wire1 = Part.Wire([edge1]) + face2 = Part.Face(wire1) + cqFace2 = Face(face2) + + # Face resulting from fuse + cqFace3 = cqFace1.fuse(cqFace2) + + self.assertEquals(len(cqFace3.Faces()), 3) + self.assertEquals(len(cqFace3.Edges()), 8) + + def testIntersect(self): + """ + Tests finding the intersection of two faces. + """ + # Face 1 + edge1 = Part.makeLine((0, 0, 0), (0, 10, 0)) + edge2 = Part.makeLine((0, 10, 0), (10, 10, 0)) + edge3 = Part.makeLine((10, 10, 0), (10, 0, 0)) + edge4 = Part.makeLine((10, 0, 0), (0, 0, 0)) + wire1 = Part.Wire([edge1,edge2,edge3,edge4]) + face1 = Part.Face(wire1) + cqFace1 = Face(face1) + + # Face 2 (face to cut out of face 1) + edge1 = Part.makeCircle(4.0) + wire1 = Part.Wire([edge1]) + face2 = Part.Face(wire1) + cqFace2 = Face(face2) + + # Face resulting from the intersection + cqFace3 = cqFace1.intersect(cqFace2) + + self.assertEquals(len(cqFace3.Faces()), 1) + self.assertEquals(len(cqFace3.Edges()), 3) + def testVertices(self): e = Shape.cast(Part.makeLine((0, 0, 0), (1, 1, 0))) self.assertEqual(2, len(e.Vertices()))