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

Commit

Permalink
Tried to get documentation Into Shape
Browse files Browse the repository at this point in the history
  • Loading branch information
dcowden committed Nov 29, 2015
1 parent 4c1a91b commit a967e1f
Show file tree
Hide file tree
Showing 53 changed files with 764 additions and 2,106 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -2,4 +2,5 @@
doc/_build/*
dist/*
.idea/*
cadquery.egg-info
cadquery.egg-info
target/*
2 changes: 2 additions & 0 deletions build-docs.sh
@@ -0,0 +1,2 @@
#!/bin/sh
sphinx-build -b html doc target/docs
8 changes: 8 additions & 0 deletions cadquery.egg-info/PKG-INFO
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
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
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: 3 additions & 1 deletion cadquery/freecad_impl/geom.py
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
53 changes: 38 additions & 15 deletions cadquery/freecad_impl/shapes.py
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
153 changes: 0 additions & 153 deletions doc/Makefile

This file was deleted.

3 changes: 2 additions & 1 deletion doc/README
@@ -1 +1,2 @@
This documentation should be generated with sphinxdoc
This documentation should be generated with sphinxdoc.
see ../build-docs.sh
Binary file modified doc/_static/block.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/_static/cqlogo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/_static/pillowblock.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/_static/quickstart/000.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/_static/quickstart/001.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/_static/quickstart/002.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/_static/quickstart/003.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/_static/quickstart/004.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/_static/quickstart/005.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/_static/simpleblock.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a967e1f

Please sign in to comment.