Updated CadQuery lib.
This commit is contained in:
parent
d8eb92cfc6
commit
30ba4dc31e
|
@ -1,5 +1,5 @@
|
||||||
"""
|
"""
|
||||||
Copyright (C) 2011-2014 Parametric Products Intellectual Holdings, LLC
|
Copyright (C) 2011-2015 Parametric Products Intellectual Holdings, LLC
|
||||||
|
|
||||||
This file is part of CadQuery.
|
This file is part of CadQuery.
|
||||||
|
|
||||||
|
@ -1336,7 +1336,7 @@ class Workplane(CQ):
|
||||||
CadQuery tracks edges as they are drawn, and automatically combines them into wires
|
CadQuery tracks edges as they are drawn, and automatically combines them into wires
|
||||||
when the user does an operation that needs it.
|
when the user does an operation that needs it.
|
||||||
|
|
||||||
Similarly, cadQuery tracks pending wires, and automaticlaly combines them into faces
|
Similarly, cadQuery tracks pending wires, and automatically combines them into faces
|
||||||
when necessary to make a solid.
|
when necessary to make a solid.
|
||||||
"""
|
"""
|
||||||
self.ctx.pendingWires.append(wire)
|
self.ctx.pendingWires.append(wire)
|
||||||
|
@ -1349,7 +1349,7 @@ class Workplane(CQ):
|
||||||
if not possible, the wires remain separated
|
if not possible, the wires remain separated
|
||||||
|
|
||||||
FreeCAD has a bug in Part.Wire([]) which does not create wires/edges properly sometimes
|
FreeCAD has a bug in Part.Wire([]) which does not create wires/edges properly sometimes
|
||||||
Additionally, it has a bug where a profile compose of two wires ( rather than one )
|
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.
|
also does not work properly. Together these are a real problem.
|
||||||
"""
|
"""
|
||||||
wires = self.wires().vals()
|
wires = self.wires().vals()
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
"""
|
"""
|
||||||
Copyright (C) 2011-2014 Parametric Products Intellectual Holdings, LLC
|
Copyright (C) 2011-2015 Parametric Products Intellectual Holdings, LLC
|
||||||
|
|
||||||
This file is part of CadQuery.
|
This file is part of CadQuery.
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
"""
|
"""
|
||||||
Copyright (C) 2011-2014 Parametric Products Intellectual Holdings, LLC
|
Copyright (C) 2011-2015 Parametric Products Intellectual Holdings, LLC
|
||||||
|
|
||||||
This file is part of CadQuery.
|
This file is part of CadQuery.
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@ def _fc_path():
|
||||||
"/usr/lib/freecad/lib",
|
"/usr/lib/freecad/lib",
|
||||||
"/opt/freecad/lib/",
|
"/opt/freecad/lib/",
|
||||||
"/usr/bin/freecad/lib",
|
"/usr/bin/freecad/lib",
|
||||||
|
"/usr/lib/freecad",
|
||||||
]:
|
]:
|
||||||
if os.path.exists(_PATH):
|
if os.path.exists(_PATH):
|
||||||
return _PATH
|
return _PATH
|
||||||
|
@ -94,5 +95,18 @@ def _fc_path():
|
||||||
if os.path.exists(_PATH):
|
if os.path.exists(_PATH):
|
||||||
return _PATH
|
return _PATH
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#Make sure that the correct FreeCAD path shows up in Python's system path
|
#Make sure that the correct FreeCAD path shows up in Python's system path
|
||||||
sys.path.insert(0, _fc_path())
|
no_library_path = ImportError('cadquery was unable to determine freecads library path')
|
||||||
|
try:
|
||||||
|
import FreeCAD
|
||||||
|
except ImportError:
|
||||||
|
path = _fc_path()
|
||||||
|
if path:
|
||||||
|
sys.path.insert(0, path)
|
||||||
|
try:
|
||||||
|
import FreeCAD
|
||||||
|
except ImportError:
|
||||||
|
raise no_library_path
|
||||||
|
else: raise no_library_path
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
"""
|
"""
|
||||||
Copyright (C) 2011-2014 Parametric Products Intellectual Holdings, LLC
|
Copyright (C) 2011-2015 Parametric Products Intellectual Holdings, LLC
|
||||||
|
|
||||||
This file is part of CadQuery.
|
This file is part of CadQuery.
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
"""
|
"""
|
||||||
Copyright (C) 2011-2014 Parametric Products Intellectual Holdings, LLC
|
Copyright (C) 2011-2015 Parametric Products Intellectual Holdings, LLC
|
||||||
|
|
||||||
This file is part of CadQuery.
|
This file is part of CadQuery.
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
"""
|
"""
|
||||||
Copyright (C) 2011-2014 Parametric Products Intellectual Holdings, LLC
|
Copyright (C) 2011-2015 Parametric Products Intellectual Holdings, LLC
|
||||||
|
|
||||||
This file is part of CadQuery.
|
This file is part of CadQuery.
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
"""
|
"""
|
||||||
Copyright (C) 2011-2014 Parametric Products Intellectual Holdings, LLC
|
Copyright (C) 2011-2015 Parametric Products Intellectual Holdings, LLC
|
||||||
|
|
||||||
This file is part of CadQuery.
|
This file is part of CadQuery.
|
||||||
|
|
||||||
|
@ -30,19 +30,19 @@
|
||||||
|
|
||||||
1. It allows us to avoid changing key api points if we change underlying implementations.
|
1. It allows us to avoid changing key api points if we change underlying implementations.
|
||||||
It would be a disaster if script and plugin authors had to change models because we
|
It would be a disaster if script and plugin authors had to change models because we
|
||||||
changed implmentations
|
changed implementations
|
||||||
|
|
||||||
2. Allow better documentation. One of the reasons FreeCAD is no more popular is because
|
2. Allow better documentation. One of the reasons FreeCAD is no more popular is because
|
||||||
its docs are terrible. This allows us to provie good documentation via docstrings
|
its docs are terrible. This allows us to provide good documentation via docstrings
|
||||||
for each wrapper
|
for each wrapper
|
||||||
|
|
||||||
3. Work around bugs. there are a quite a feb bugs in free this layer allows fixing them
|
3. Work around bugs. there are a quite a feb bugs in free this layer allows fixing them
|
||||||
|
|
||||||
4. allows for enhanced functionality. Many objects are missing features we need. For example
|
4. allows for enhanced functionality. Many objects are missing features we need. For example
|
||||||
we need a 'forConstruciton' flag on the Wire object. this allows adding those kinds of things
|
we need a 'forConstruction' flag on the Wire object. this allows adding those kinds of things
|
||||||
|
|
||||||
5. allow changing interfaces when we'd like. there are few cases where the freecad api is not
|
5. allow changing interfaces when we'd like. there are few cases where the FreeCAD api is not
|
||||||
very userfriendly: we like to change those when necesary. As an example, in the freecad api,
|
very user friendly: we like to change those when necessary. As an example, in the FreeCAD api,
|
||||||
all factory methods are on the 'Part' object, but it is very useful to know what kind of
|
all factory methods are on the 'Part' object, but it is very useful to know what kind of
|
||||||
object each one returns, so these are better grouped by the type of object they return.
|
object each one returns, so these are better grouped by the type of object they return.
|
||||||
(who would know that Part.makeCircle() returns an Edge, but Part.makePolygon() returns a Wire ?
|
(who would know that Part.makeCircle() returns an Edge, but Part.makePolygon() returns a Wire ?
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"""
|
"""
|
||||||
CadQuery
|
CadQuery
|
||||||
Copyright (C) 2014 Parametric Products Intellectual Holdings, LLC
|
Copyright (C) 2015 Parametric Products Intellectual Holdings, LLC
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Lesser General Public
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
"""
|
"""
|
||||||
Copyright (C) 2011-2014 Parametric Products Intellectual Holdings, LLC
|
Copyright (C) 2011-2015 Parametric Products Intellectual Holdings, LLC
|
||||||
|
|
||||||
This file is part of CadQuery.
|
This file is part of CadQuery.
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ import re
|
||||||
import math
|
import math
|
||||||
from cadquery import Vector,Edge,Vertex,Face,Solid,Shell,Compound
|
from cadquery import Vector,Edge,Vertex,Face,Solid,Shell,Compound
|
||||||
|
|
||||||
|
|
||||||
class Selector(object):
|
class Selector(object):
|
||||||
"""
|
"""
|
||||||
Filters a list of objects
|
Filters a list of objects
|
||||||
|
|
Loading…
Reference in New Issue
Block a user