Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Commit

Permalink
Merge 9b0fa9d into d8d5669
Browse files Browse the repository at this point in the history
  • Loading branch information
dcowden committed Dec 2, 2015
2 parents d8d5669 + 9b0fa9d commit 225f444
Show file tree
Hide file tree
Showing 58 changed files with 782 additions and 2,165 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
doc/_build/*
dist/*
.idea/*
cadquery.egg-info
cadquery.egg-info
target/*
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ install:
- python ./setup.py install
- pip install coverage
- pip install coveralls
- pip install Sphinx==1.3.2
- pip install travis-sphinx

script:
- coverage run --source=cadquery ./runtests.py
- travis-sphinx --nowarn --source=doc build

after_success:
- coveralls
- travis-sphinx deploy

branches:
except:
Expand Down
2 changes: 2 additions & 0 deletions build-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
sphinx-build -b html doc target/docs
8 changes: 8 additions & 0 deletions cadquery.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ Description: What is a CadQuery?

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?
========================================

Expand Down
1 change: 0 additions & 1 deletion cadquery.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ cadquery.egg-info/PKG-INFO
cadquery.egg-info/SOURCES.txt
cadquery.egg-info/dependency_links.txt
cadquery.egg-info/not-zip-safe
cadquery.egg-info/pbr.json
cadquery.egg-info/top_level.txt
cadquery/contrib/__init__.py
cadquery/freecad_impl/__init__.py
Expand Down
3 changes: 1 addition & 2 deletions cadquery/CQ.py
Original file line number Diff line number Diff line change
Expand Up @@ -1735,8 +1735,7 @@ def cutEach(self, fcn, useLocalCoords=False, clean=True):
"""
Evaluates the provided function at each point on the stack (ie, eachpoint)
and then cuts the result from the context solid.
:param fcn: a function suitable for use in the eachpoint method: ie, that accepts
a vector
:param fcn: a function suitable for use in the eachpoint method: ie, that accepts a vector
:param useLocalCoords: same as for :py:meth:`eachpoint`
:param boolean clean: call :py:meth:`clean` afterwards to have a clean shape
:return: a CQ object that contains the resulting solid
Expand Down
4 changes: 2 additions & 2 deletions cadquery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#these items are the common implementation

#the order of these matter
from .selectors import NearestToPointSelector,ParallelDirSelector,DirectionSelector,PerpendicularDirSelector,TypeSelector,DirectionMinMaxSelector,StringSyntaxSelector,Selector
from .CQ import CQ,CQContext,Workplane
from .selectors import *
from .CQ import *


__all__ = [
Expand Down
21 changes: 0 additions & 21 deletions cadquery/freecad_impl/exporters.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
"""
Copyright (C) 2011-2015 Parametric Products Intellectual Holdings, LLC
This file is part of CadQuery.
CadQuery is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
CadQuery is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; If not, see <http://www.gnu.org/licenses/>
An exporter should provide functionality to accept a shape, and return
a string containing the model content.
"""
import cadquery

import FreeCAD
Expand Down
4 changes: 3 additions & 1 deletion cadquery/freecad_impl/geom.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,8 @@ def origin(self, value):
self._calcTransforms()

def setOrigin2d(self, x, y):
"""Set a new origin in the plane itself
"""
Set a new origin in the plane itself
Set a new origin in the plane itself. The plane's orientation and
xDrection are unaffected.
Expand All @@ -377,6 +378,7 @@ def setOrigin2d(self, x, y):
p = Plane.XY()
p.setOrigin2d(2, 2)
p.setOrigin2d(2, 2)
results in a plane with its origin at (x, y) = (4, 4) in global
coordinates. Both operations were relative to local coordinates of the
plane.
Expand Down
20 changes: 0 additions & 20 deletions cadquery/freecad_impl/importers.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
"""
Copyright (C) 2011-2015 Parametric Products Intellectual Holdings, LLC

This file is part of CadQuery.
CadQuery is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
CadQuery is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; If not, see <http://www.gnu.org/licenses/>
An exporter should provide functionality to accept a shape, and return
a string containing the model content.
"""
import cadquery
from .shapes import Shape

Expand Down
53 changes: 38 additions & 15 deletions cadquery/freecad_impl/shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,10 @@ def __hash__(self):


class Vertex(Shape):
"""
A Single Point in Space
"""

def __init__(self, obj, forConstruction=False):
"""
Create a vertex from a FreeCAD Vertex
Expand All @@ -373,6 +377,10 @@ def Center(self):


class Edge(Shape):
"""
A trimmed curve that represents the border of a face
"""

def __init__(self, obj):
"""
An Edge
Expand Down Expand Up @@ -479,6 +487,10 @@ def makeLine(cls, v1, v2):


class Wire(Shape):
"""
A series of connected, ordered Edges, that typically bounds a Face
"""

def __init__(self, obj):
"""
A Wire
Expand Down Expand Up @@ -545,10 +557,11 @@ def clean(self):
return self

class Face(Shape):
"""
a bounded surface that represents part of the boundary of a solid
"""
def __init__(self, obj):
"""
A Face
"""

self.wrapped = obj

self.facetypes = {
Expand Down Expand Up @@ -611,6 +624,9 @@ def intersect(self, faceToIntersect):


class Shell(Shape):
"""
the outer boundary of a surface
"""
def __init__(self, wrapped):
"""
A Shell
Expand All @@ -626,6 +642,9 @@ def makeShell(cls, listOfFaces):


class Solid(Shape):
"""
a single solid
"""
def __init__(self, obj):
"""
A Solid
Expand All @@ -649,36 +668,36 @@ def isSolid(cls, obj):
@classmethod
def makeBox(cls, length, width, height, pnt=Vector(0, 0, 0), dir=Vector(0, 0, 1)):
"""
makeBox(length,width,height,[pnt,dir]) -- Make a box located\nin pnt with the d
imensions (length,width,height)\nBy default pnt=Vector(0,0,0) and dir=Vector(0,0,1)'
makeBox(length,width,height,[pnt,dir]) -- Make a box located\nin pnt with the d
imensions (length,width,height)\nBy default pnt=Vector(0,0,0) and dir=Vector(0,0,1)'
"""
return Shape.cast(FreeCADPart.makeBox(length, width, height, pnt.wrapped, dir.wrapped))

@classmethod
def makeCone(cls, radius1, radius2, height, pnt=Vector(0, 0, 0), dir=Vector(0, 0, 1), angleDegrees=360):
"""
'makeCone(radius1,radius2,height,[pnt,dir,angle]) --
Make a cone with given radii and height\nBy default pnt=Vector(0,0,0),
dir=Vector(0,0,1) and angle=360'
'makeCone(radius1,radius2,height,[pnt,dir,angle]) --
Make a cone with given radii and height\nBy default pnt=Vector(0,0,0),
dir=Vector(0,0,1) and angle=360'
"""
return Shape.cast(FreeCADPart.makeCone(radius1, radius2, height, pnt.wrapped, dir.wrapped, angleDegrees))

@classmethod
def makeCylinder(cls, radius, height, pnt=Vector(0, 0, 0), dir=Vector(0, 0, 1), angleDegrees=360):
"""
makeCylinder(radius,height,[pnt,dir,angle]) --
Make a cylinder with a given radius and height
By default pnt=Vector(0,0,0),dir=Vector(0,0,1) and angle=360'
makeCylinder(radius,height,[pnt,dir,angle]) --
Make a cylinder with a given radius and height
By default pnt=Vector(0,0,0),dir=Vector(0,0,1) and angle=360'
"""
return Shape.cast(FreeCADPart.makeCylinder(radius, height, pnt.wrapped, dir.wrapped, angleDegrees))

@classmethod
def makeTorus(cls, radius1, radius2, pnt=None, dir=None, angleDegrees1=None, angleDegrees2=None):
"""
makeTorus(radius1,radius2,[pnt,dir,angle1,angle2,angle]) --
Make a torus with agiven radii and angles
By default pnt=Vector(0,0,0),dir=Vector(0,0,1),angle1=0
,angle1=360 and angle=360'
makeTorus(radius1,radius2,[pnt,dir,angle1,angle2,angle]) --
Make a torus with agiven radii and angles
By default pnt=Vector(0,0,0),dir=Vector(0,0,1),angle1=0
,angle1=360 and angle=360'
"""
return Shape.cast(FreeCADPart.makeTorus(radius1, radius2, pnt, dir, angleDegrees1, angleDegrees2))

Expand Down Expand Up @@ -930,6 +949,10 @@ def shell(self, faceList, thickness, tolerance=0.0001):


class Compound(Shape):
"""
a collection of disconnected solids
"""

def __init__(self, obj):
"""
An Edge
Expand Down
Loading

0 comments on commit 225f444

Please sign in to comment.