Merge remote-tracking branch 'upstream/master' into feature_isinside

This commit is contained in:
Michael Greminger
2019-06-24 10:14:22 -05:00
13 changed files with 225 additions and 215 deletions

129
README.md
View File

@ -1,12 +1,135 @@
![CadQuery logo](http://dcowden.github.io/cadquery/_static/cadquery_logo_dark.svg)
# CadQuery
[![Travis Build Status](https://travis-ci.org/CadQuery/cadquery.svg?branch=master)](https://travis-ci.org/CadQuery/cadquery.svg?branch=master)
[![Appveyor Build status](https://ci.appveyor.com/api/projects/status/cf4qg6kpyqmcje1h?svg=true)](https://ci.appveyor.com/api/projects/status/cf4qg6kpyqmcje1h?svg=true)
[![Build Status](https://dev.azure.com/cadquery/conda-packages/_apis/build/status/CadQuery.cadquery?branchName=master)](https://dev.azure.com/cadquery/conda-packages/_build/latest?definitionId=2&branchName=master)
[![codecov](https://codecov.io/gh/CadQuery/cadquery/branch/master/graph/badge.svg)](https://codecov.io/gh/CadQuery/cadquery)
[![Documentation Status](https://readthedocs.org/projects/cadquery/badge/?version=latest)](https://cadquery.readthedocs.io/en/latest/?badge=latest)
## What is CadQuery
This is an experimental CadQuery fork that uses PythonOCC instead of FreeCAD. It also has preliminary Jupyter notebook integration.
CadQuery is an intuitive, easy-to-use Python module for building parametric 3D CAD models. Using CadQuery, you can write short, simple scripts that produce high quality CAD models. It is easy to make many different objects using a single script that can be customized.
You can try it out on linux-64, osx-64 and win-64 using conda:
CadQuery is often compared to [OpenSCAD](http://www.openscad.org/). Like OpenSCAD, CadQuery is an open-source, script based, parametric model generator. However, CadQuery stands out in many ways and has several key advantages:
1. The scripts use a standard programming language, Python, and thus can benefit from the associated infrastructure. This includes many standard libraries and IDEs.
2. CadQuery's CAD kernel OpenCascade is much more powerful than CGAL. Features supported natively by OCC include NURBS, splines, surface sewing, STL repair, STEP import/export, and other complex operations, in addition to the standard CSG operations supported by CGAL
3. Ability to import/export STEP and the ability to begin with a STEP model, created in a CAD package, and then add parametric features. This is possible in OpenSCAD using STL, but STL is a lossy format.
4. CadQuery scripts require less code to create most objects, because it is possible to locate features based on the position of other features, workplanes, vertices, etc.
5. CadQuery scripts can build STL, STEP, and AMF faster than OpenSCAD.
### Key features
* Build 3D models with scripts that are as close as possible to how you would describe the object to a human.
* Create parametric models that can be very easily customized by end users.
* Output high quality (loss-less) CAD formats like STEP in addition to STL and AMF.
* Provide a non-proprietary, plain text model format that can be edited and executed with only a web browser.
* Offer advanced modeling capabilities such as fillets, curvelinear extrudes, parametric curves and lofts.
### Why this fork
The original version of CadQuery was built on the FreeCAD API. This was great because it allowed for fast development and easy cross-platform capability. However, we eventually started reaching the limits of the API for some advanced operations and selectors. This 2.0 version of CadQuery is based on Python-OCC, which is a Python wrapper around the OpenCASCADE kernel. This gives us a great deal more control and flexibility, at the expense of some simplicity and having to handle the cross-platform aspects of deployment ourselves. We believe this is a worthwhile trade-off to allow CadQuery to continue to grow and expand in the future.
## Getting started
It is currently possible to use CadQuery for your own projects in 3 different ways:
* Using the [CQ-editor GUI](https://github.com/CadQuery/CQ-editor)
* From a [Jupyter notebook](https://github.com/bernhard-42/jupyter-cadquery)
* As a standalone library
The easiest way to install CadQuery and its dependencies is using conda:
```
conda install -c conda-forge -c cadquery cadquery=2
```
For those who are interested, the [conda-packages repository](https://github.com/CadQuery/conda-packages) contains build information, packages and modifications for CadQuery's conda channel.
### CQ-editor GUI
CQ-editor is an IDE that allows users to edit CadQuery model scripts in a GUI environment. It includes features such as:
* A graphical debugger that allows you to step through your scripts.
* A CadQuery stack inspector.
* Export to various formats, including STEP and STL, directly from the menu.
The installation instructions for CQ-editor can be found [here](https://github.com/CadQuery/CQ-editor#installation).
<img src="https://raw.githubusercontent.com/CadQuery/CQ-editor/master/screenshots/screenshot3.png" alt="CQ editor screenshot" width="800"/>
### Jupyter
CadQuery supports Jupyter notebook out of the box using the jupyter-cadquery extension created by @bernhard-42:
* [Installation](https://github.com/bernhard-42/jupyter-cadquery#installation)
* [Usage](https://github.com/bernhard-42/jupyter-cadquery#jupyter-cadquery)
<img src="https://raw.githubusercontent.com/bernhard-42/jupyter-cadquery/master/screenshots/0_intro.png" alt="CadQuery Jupyter extension screenshot" width="800"/>
### Standalone
CadQuery was built to be used as a Python library without any GUI. This makes it great for use cases such as integration into servers, or creating scientific and engineering scripts. Use Anaconda/Miniconda to install CadQuery, and then add `import cadquery` to the top of your Python scripts.
```
conda install -c pythonocc -c oce -c conda-forge -c dlr-sc -c CadQuery cadquery-occ
conda install -c conda-forge -c cadquery cadquery=2
```
## Getting help
You can find the full CadQuery documentation at [cadquery.readthedocs.io](https://cadquery.readthedocs.io/).
We also have a [Google Group](https://groups.google.com/forum/#!forum/cadquery) to make it easy to get help from other CadQuery users. We want you to feel welcome and encourage you to join the group and introduce yourself. We would also love to hear what you are doing with CadQuery.
## Projects using CadQuery
Here are just a few examples of how CadQuery is being used.
### Resin Mold for Cable Repair
Thanks to @hyOzd ( Altu Technology ) for this example.
![Resin mold example](https://camo.githubusercontent.com/3dcbe1b644b4b831d88e323ab5414a392d7feef0/687474703a2f2f64636f7764656e2e6769746875622e696f2f63616471756572792f5f7374617469632f68794f7a642d6361626c656669782e706e67) ![Resin mold being machined](http://dcowden.github.io/cadquery/_static/hyOzd-finished_thumb.jpg)
### Generation of KiCAD Component Files
Thanks to @easyw for this example from the [kicad-3d-models-in-freecad project](https://github.com/easyw/kicad-3d-models-in-freecad).
<img src="http://dcowden.github.io/cadquery/_static/KiCad_Capacitors_SMD.jpg" alt="Circuit board generated in KiCAD" width="400"/>
### 3D Printed Resin Mold
Thanks to @eddieliberato for this example.
<img src="https://user-images.githubusercontent.com/13981538/55984103-f7968080-5c9c-11e9-94ef-b02b28be4432.png" alt="3D printed resin mold" height="250"/> <img src="https://user-images.githubusercontent.com/13981538/55984149-1ac13000-5c9d-11e9-9825-c0aadbadd280.png" alt="3D printed resin mold" height="250"/>
## License
CadQuery is licensed under the terms of the [Apache Public License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
## Contributing
Contributions from the community are welcome and appreciated.
You do not need to be a software developer to have a big impact on this project. Contributions can take many forms including, but not limited to, the following:
* Writing and improving documentation
* Triaging bugs
* Submitting bugs and feature requests
* Creating tutorial videos and blog posts
* Helping other users get started and solve problems
* Telling others about this project
* Helping with translations and internationalization
* Helping with accessibility
* Contributing bug fixes and new features
It is asked that all contributions to this project be made in a respectful and considerate way. Please use the [Python Community Code of Conduct's](https://www.python.org/psf/codeofconduct/) guidelines as a reference.
### How to Report a Bug
When filing a bug report [issue](https://github.com/CadQuery/cadquery/issues), please be sure to answer these questions:
1. What version of the software are you running?
2. What operating system are you running the software on?
3. What are the steps to reproduce the bug?
### How to Suggest a Feature or Enhancement
If you find yourself wishing for a feature that does not exist, you are probably not alone. There are bound to be others out there with similar needs. Open an [issue](https://github.com/CadQuery/cadquery/issues) which describes the feature you would like to see, why you need it, and how it should work.

View File

@ -1,125 +0,0 @@
What is a CadQuery?
========================================
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!
CadQuery has several goals:
* Build models with scripts that are as close as possible to how you'd describe the object to a human.
* Create parametric models that can be very easily customized by end users
* Output high quality CAD formats like STEP and AMF in addition to traditional STL
* Provide a non-proprietary, plain text model format that can be edited and executed with only a web browser
Using CadQuery, you can write short, simple scripts that produce high quality CAD models. It is easy to make many different objects using a single script that can be customized.
Getting Started With CadQuery
========================================
The easiest way to get started with CadQuery is to Install FreeCAD ( version 14 recommended ) (http://www.freecadweb.org/) , and then to use our CadQuery-FreeCAD plugin here:
https://github.com/jmwright/cadquery-freecad-module
It includes the latest version of cadquery alreadby bundled, and has super-easy installation on Mac, Windows, and Unix.
It has tons of awesome features like integration with FreeCAD so you can see your objects, code-autocompletion, an examples bundle, and script saving/loading. Its definitely the best way to kick the tires!
Recently Added Features
========================================
* 12/5/14 -- New FreeCAD/CadQuery Module! https://github.com/jmwright/cadquery-freecad-module
* 10/25/14 -- Added Revolution Feature ( thanks Jeremy ! )
Why CadQuery instead of OpenSCAD?
========================================
CadQuery is based on OpenCasCade. CadQuery shares many features with OpenSCAD, another open source, script based, parametric model generator.
The primary advantage of OpenSCAD is the large number of already existing model libaries that exist already. So why not simply use OpenSCAD?
CadQuery scripts have several key advantages over OpenSCAD:
1. **The scripts use a standard programming language**, python, and thus can benefit from the associated infrastructure.
This includes many standard libraries and IDEs
2. **More powerful CAD kernel** OpenCascade is much more powerful than CGAL. Features supported natively
by OCC include NURBS, splines, surface sewing, STL repair, STEP import/export, and other complex operations,
in addition to the standard CSG operations supported by CGAL
3. **Ability to import/export STEP** We think the ability to begin with a STEP model, created in a CAD package,
and then add parametric features is key. This is possible in OpenSCAD using STL, but STL is a lossy format
4. **Less Code and easier scripting** CadQuery scripts require less code to create most objects, because it is possible to locate
features based on the position of other features, workplanes, vertices, etc.
5. **Better Performance** CadQuery scripts can build STL, STEP, and AMF faster than OpenSCAD.
License
========
CadQuery is licensed under the terms of the LGPLv3. http://www.gnu.org/copyleft/lesser.html
Where is the GUI?
==================
If you would like IDE support, you can use CadQuery inside of FreeCAD. There's an excellent plugin module here https://github.com/jmwright/cadquery-freecad-module
CadQuery also provides the backbone of http://parametricparts.com, so the easiest way to see it in action is to review the samples and objects there.
Installing -- FreeStanding Installation
========================================
Use these steps if you would like to write CadQuery scripts as a python API. In this case, FreeCAD is used only as a CAD kernel.
1. install FreeCAD, version 0.14 or greater for your platform. http://sourceforge.net/projects/free-cad/.
2. adjust your path if necessary. FreeCAD bundles a python interpreter, but you'll probably want to use your own,
preferably one that has virtualenv available. To use FreeCAD from any python interpreter, just append the FreeCAD
lib directory to your path. On (*Nix)::
import sys
sys.path.append('/usr/lib/freecad/lib')
or on Windows::
import sys
sys.path.append('/c/apps/FreeCAD/bin')
*NOTE* FreeCAD on Windows will not work with python 2.7-- you must use pthon 2.6.X!!!!
3. install cadquery::
pip install cadquery
3. test your installation::
from cadquery import *
box = Workplane("XY").box(1,2,3)
exporters.toString(box,'STL')
You're up and running!
Installing -- Using CadQuery from Inside FreeCAD
=================================================
Use the Excellent CadQuery-FreeCAD plugin here:
https://github.com/jmwright/cadquery-freecad-module
It includes a distribution of the latest version of cadquery.
Where does the name CadQuery come from?
========================================
CadQuery is inspired by ( `jQuery <http://www.jquery.com>`_ ), a popular framework that
revolutionized web development involving javascript.
If you are familiar with how jQuery, you will probably recognize several jQuery features that CadQuery uses:
* A fluent api to create clean, easy to read code
* Language features that make selection and iteration incredibly easy
*
* Ability to use the library along side other python libraries
* Clear and complete documentation, with plenty of samples.

36
azure-pipelines.yml Normal file
View File

@ -0,0 +1,36 @@
trigger:
branches:
include:
- master
- refs/tags/*
pr: none
resources:
repositories:
- repository: templates
type: github
name: CadQuery/conda-packages
endpoint: CadQuery
jobs:
- template: conda-build.yml@templates
parameters:
name: Linux
vmImage: 'ubuntu-16.04'
py_maj: 3
py_min: 6
- template: conda-build.yml@templates
parameters:
name: macOS
vmImage: 'macOS-10.13'
py_maj: 3
py_min: 6
- template: conda-build.yml@templates
parameters:
name: Windows
vmImage: 'vs2017-win2016'
py_maj: 3
py_min: 6

View File

@ -147,10 +147,8 @@ class CQ(object):
# Put the one we are keeping on the stack, and also update the
# context solidto the one we kept.
if keepTop:
solid.wrapped = top.wrapped
return self.newObject([top])
else:
solid.wrapped = bottom.wrapped
return self.newObject([bottom])
def combineSolids(self, otherCQToCombine=None):
@ -2378,12 +2376,10 @@ class Workplane(CQ):
return self.newObject([s])
def union(self, toUnion=None, combine=True, clean=True):
def union(self, toUnion=None, clean=True):
"""
Unions all of the items on the stack of toUnion with the current solid.
If there is no current solid, the items in toUnion are unioned together.
if combine=True, the result and the original are updated to point to the new object
if combine=False, the result will be on the stack, but the original is unmodified
:param toUnion:
:type toUnion: a solid object, or a CQ object having a solid,
@ -2409,9 +2405,8 @@ class Workplane(CQ):
# now combine with existing solid, if there is one
# look for parents to cut from
solidRef = self.findSolid(searchStack=True, searchParents=True)
if combine and solidRef is not None:
if solidRef is not None:
r = solidRef.fuse(newS)
solidRef.wrapped = newS.wrapped
else:
r = newS
@ -2420,13 +2415,10 @@ class Workplane(CQ):
return self.newObject([r])
def cut(self, toCut, combine=True, clean=True):
def cut(self, toCut, clean=True):
"""
Cuts the provided solid from the current solid, IE, perform a solid subtraction
if combine=True, the result and the original are updated to point to the new object
if combine=False, the result will be on the stack, but the original is unmodified
:param toCut: object to cut
:type toCut: a solid object, or a CQ object having a solid,
:param boolean clean: call :py:meth:`clean` afterwards to have a clean shape
@ -2452,18 +2444,12 @@ class Workplane(CQ):
if clean:
newS = newS.clean()
if combine:
solidRef.wrapped = newS.wrapped
return self.newObject([newS])
def intersect(self, toIntersect, combine=True, clean=True):
def intersect(self, toIntersect, clean=True):
"""
Intersects the provided solid from the current solid.
if combine=True, the result and the original are updated to point to the new object
if combine=False, the result will be on the stack, but the original is unmodified
:param toIntersect: object to intersect
:type toIntersect: a solid object, or a CQ object having a solid,
:param boolean clean: call :py:meth:`clean` afterwards to have a clean shape
@ -2489,9 +2475,6 @@ class Workplane(CQ):
if clean: newS = newS.clean()
if combine:
solidRef.wrapped = newS.wrapped
return self.newObject([newS])
def cutBlind(self, distanceToCut, clean=True, taper=None):
@ -2528,15 +2511,14 @@ class Workplane(CQ):
return self.newObject([s])
def cutThruAll(self, positive=False, clean=True, taper=0):
def cutThruAll(self, clean=True, taper=0):
"""
Use all un-extruded wires in the parent chain to create a prismatic cut from existing solid.
Cuts through all material in both normal directions of workplane.
Similar to extrude, except that a solid in the parent chain is required to remove material
from. cutThruAll always removes material from a part.
:param boolean positive: True to cut in the positive direction, false to cut in the
negative direction
:param boolean clean: call :py:meth:`clean` afterwards to have a clean shape
:raises: ValueError if there is no solid to subtract from in the chain
:return: a CQ object with the resulting object selected
@ -2584,7 +2566,6 @@ class Workplane(CQ):
parentSolid = self.findSolid(searchStack=False, searchParents=True)
if parentSolid is not None:
r = parentSolid.fuse(r)
parentSolid.wrapped = r.wrapped
return self.newObject([r])

View File

@ -115,7 +115,7 @@ from functools import reduce
TOLERANCE = 1e-6
DEG2RAD = 2 * pi / 360.
HASH_CODE_MAX = int(1e+6) # required by OCC.Core.HashCode
HASH_CODE_MAX = 2147483647 # max 32bit signed int, required by OCC.Core.HashCode
shape_LUT = \
{ta.TopAbs_VERTEX: 'Vertex',

View File

@ -526,13 +526,11 @@ class _SimpleStringSyntaxSelector(Selector):
self.operatorMinMax = {
'>': True,
'<': False,
'+': True,
'-': False
}
self.operator = {
'+': DirectionSelector,
'-': DirectionSelector,
'-': lambda v: DirectionSelector(-v),
'#': PerpendicularDirSelector,
'|': ParallelDirSelector}

View File

@ -1,23 +1,30 @@
package:
name: cadquery-occ
version: {{ environ.get('TRAVIS_TAG') }}
name: cadquery
version: {{ environ.get('PACKAGE_VERSION') }}
source:
path: ..
build:
string: {{ 'py'+environ.get('TRAVIS_PYTHON_VERSION')+environ.get('TRAVIS_COMMIT')[:8] }}
string: {{ 'py'+environ.get('PYTHON_VERSION')}}
script: python setup.py install --single-version-externally-managed --record=record.txt
requirements:
build:
- python {{ environ.get('TRAVIS_PYTHON_VERSION') }}
- python {{ environ.get('PYTHON_VERSION') }}
- setuptools
run:
- python {{ environ.get('TRAVIS_PYTHON_VERSION') }}
- oce 0.18
- pythonocc-core 0.18.2
- python {{ environ.get('PYTHON_VERSION') }}
- oce 0.18.*
- pythonocc-core 0.18.2*
- pyparsing 2.*
test:
source_files:
- runtests.py
- tests/
commands:
- python runtests.py
about:
summary: Experimental CadQuery fork based on PythonOCC
summary: CadQuery fork based on PythonOCC

View File

@ -50,7 +50,10 @@ All 2-d operations require a **Workplane** object to be created.
Workplane.moveTo
Workplane.move
Workplane.spline
Workplane.parametricCurve
Workplane.threePointArc
Workplane.sagittaArc
Workplane.radiusArc
Workplane.rotateAndCopy
Workplane.mirrorY
Workplane.mirrorX
@ -60,6 +63,7 @@ All 2-d operations require a **Workplane** object to be created.
Workplane.polyline
Workplane.close
Workplane.rarray
Workplane.polarArray
.. _3doperations:
@ -79,18 +83,28 @@ Some 3-d operations also require an active 2-d workplane, but some do not.
Workplane.cutBlind
Workplane.cutThruAll
Workplane.box
Workplane.sphere
Workplane.union
Workplane.combine
Workplane.intersect
Workplane.loft
Workplane.sweep
Workplane.twistExtrude
Workplane.revolve
Workplane.text
3-d operations that do NOT require a 2-d workplane to be active:
.. autosummary::
CQ.shell
CQ.fillet
CQ.chamfer
CQ.split
CQ.rotate
CQ.rotateAboutCenter
CQ.translate
CQ.mirror
File Management and Export
---------------------------------

View File

@ -16,7 +16,7 @@ Command Line Installation
Once you have Anaconda or Miniconda installed, activate the environment you want to use and type::
conda install -c pythonocc -c oce -c conda-forge -c dlr-sc -c CadQuery cadquery-occ
conda install -c conda-forge -c cadquery cadquery=2
Test Your Installation
------------------------

View File

@ -83,13 +83,6 @@ construction lines
mirror around centerline
using centerline construction geometry
rectangular array
automate creation of equally spread points
polar array
create equally spaced copies of a feature around a circle
perhaps based on a construction circle?
midpoint selection
select midpoints of lines, arcs
@ -106,9 +99,6 @@ feature snap
polyline edges
allow polyline to be combined with other edges/curves
create text
ideally, in various fonts.
3-d operations
---------------------
@ -118,7 +108,6 @@ rotation/transform that return a copy
primitive creation
Need primitive creation for:
* cone
* sphere
* cylinder
* torus
* wedge
@ -126,21 +115,6 @@ primitive creation
extrude/cut up to surface
allow a cut or extrude to terminate at another surface, rather than either through all or a fixed distance
extrude along a path
rather than just normal to the plane. This would include
STEP import
allow embedding and importing step solids created in other tools, which
can then be further manipulated parametrically
Dome
very difficult to do otherwise
primitive boolean operations
* intersect
* union
* subtract
Algorithms
---------------------

View File

@ -3,6 +3,7 @@ import cadquery as cq
# These can be modified rather than hardcoding values for each dimension.
length = 80.0 # Length of the block
width = 60.0 # Width of the block
height = 100.0 # Height of the block
thickness = 10.0 # Thickness of the block
center_hole_dia = 22.0 # Diameter of center hole in block
cbore_hole_diameter = 2.4 # Bolt shank/threads clearance hole diameter

View File

@ -122,6 +122,8 @@ class TestCQSelectors(BaseTest):
self.assertEqual(1, c.faces("+Y").size())
self.assertEqual(1, c.faces("-Y").size())
self.assertEqual(0, c.faces("XY").size())
self.assertEqual(c.faces("+X").val().Center(), c.faces("X").val().Center())
self.assertNotEqual(c.faces("+X").val().Center(), c.faces("-X").val().Center())
def testParallelPlaneFaceFilter(self):
c = CQ(makeUnitCube())

View File

@ -771,9 +771,9 @@ class TestCadQuery(BaseTest):
currentS = s.rect(2.0, 2.0).extrude(0.5)
toCut = s.rect(1.0, 1.0).extrude(0.5)
currentS.cut(toCut.val())
resS = currentS.cut(toCut.val())
self.assertEqual(10, currentS.faces().size())
self.assertEqual(10, resS.faces().size())
def testIntersect(self):
"""
@ -783,15 +783,15 @@ class TestCadQuery(BaseTest):
currentS = s.rect(2.0, 2.0).extrude(0.5)
toIntersect = s.rect(1.0, 1.0).extrude(1)
currentS.intersect(toIntersect.val())
resS = currentS.intersect(toIntersect.val())
self.assertEqual(6, currentS.faces().size())
self.assertAlmostEqual(currentS.val().Volume(),0.5)
self.assertEqual(6, resS.faces().size())
self.assertAlmostEqual(resS.val().Volume(),0.5)
currentS.intersect(toIntersect)
resS = currentS.intersect(toIntersect)
self.assertEqual(6, currentS.faces().size())
self.assertAlmostEqual(currentS.val().Volume(),0.5)
self.assertEqual(6, resS.faces().size())
self.assertAlmostEqual(resS.val().Volume(),0.5)
def testBoundingBox(self):
"""
@ -1227,9 +1227,9 @@ class TestCadQuery(BaseTest):
self.assertEqual(7, c.faces().size())
# now cut it in half sideways
c.faces(">Y").workplane(-0.5).split(keepTop=True)
self.saveModel(c)
self.assertEqual(8, c.faces().size())
result = c.faces(">Y").workplane(-0.5).split(keepTop=True)
self.saveModel(result)
self.assertEqual(8, result.faces().size())
def testSplitKeepingBoth(self):
"""
@ -1414,10 +1414,9 @@ class TestCadQuery(BaseTest):
currentS = s.rect(2.0, 2.0).extrude(0.5)
toUnion = s.rect(1.0, 1.0).extrude(1.0)
currentS.union(toUnion.val(), combine=False)
resS = currentS.union(toUnion)
# TODO: When unioning and combining is figured out, uncomment the following assert
# self.assertEqual(10,currentS.faces().size())
self.assertEqual(11,resS.faces().size())
def testCombine(self):
s = Workplane(Plane.XY())
@ -1836,13 +1835,13 @@ class TestCadQuery(BaseTest):
box = Workplane("XY" ).box(4, 4, 0.5)
obj1 = box.faces('>Z').workplane()\
.text('CQ 2.0',0.5,-.05,cut=True,halign='left',valign='bottom')
.text('CQ 2.0',0.5,-.05,cut=True,halign='left',valign='bottom', font='Sans')
#combined object should have smaller volume
self.assertGreater(box.val().Volume(),obj1.val().Volume())
obj2 = box.faces('>Z').workplane()\
.text('CQ 2.0',0.5,.05,cut=False,combine=True)
.text('CQ 2.0',0.5,.05,cut=False,combine=True, font='Sans')
#combined object should have bigger volume
self.assertLess(box.val().Volume(),obj2.val().Volume())
@ -1851,7 +1850,7 @@ class TestCadQuery(BaseTest):
self.assertEqual(len(obj2.faces('>Z').vals()),5)
obj3 = box.faces('>Z').workplane()\
.text('CQ 2.0',0.5,.05,cut=False,combine=False,halign='right',valign='top')
.text('CQ 2.0',0.5,.05,cut=False,combine=False,halign='right',valign='top', font='Sans')
#verify that the number of solids is correct
self.assertEqual(len(obj3.solids().vals()),5)