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

Commit

Permalink
Added a label instance attribute to each of the shapes so that they c…
Browse files Browse the repository at this point in the history
…an be identified separately.
  • Loading branch information
jmwright committed Nov 24, 2015
1 parent b1a6187 commit 007725a
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions cadquery/freecad_impl/shapes.py
Expand Up @@ -62,6 +62,9 @@ def __init__(self, obj):
self.wrapped = obj
self.forConstruction = False

# Helps identify this solid through the use of an ID
self.label = ""

@classmethod
def cast(cls, obj, forConstruction=False):
"Returns the right type of wrapper, given a FreeCAD object"
Expand Down Expand Up @@ -356,6 +359,9 @@ def __init__(self, obj, forConstruction=False):
self.Y = obj.Y
self.Z = obj.Z

# Helps identify this solid through the use of an ID
self.label = ""

def toTuple(self):
return (self.X, self.Y, self.Z)

Expand All @@ -381,6 +387,9 @@ def __init__(self, obj):
FreeCADPart.Circle: 'CIRCLE'
}

# Helps identify this solid through the use of an ID
self.label = ""

def geomType(self):
t = type(self.wrapped.Curve)
if self.edgetypes.has_key(t):
Expand Down Expand Up @@ -476,6 +485,9 @@ def __init__(self, obj):
"""
self.wrapped = obj

# Helps identify this solid through the use of an ID
self.label = ""

@classmethod
def combine(cls, listOfWires):
"""
Expand Down Expand Up @@ -546,6 +558,9 @@ def __init__(self, obj):
FreeCADPart.Cone: 'CONE'
}

# Helps identify this solid through the use of an ID
self.label = ""

def geomType(self):
t = type(self.wrapped.Surface)
if self.facetypes.has_key(t):
Expand Down Expand Up @@ -602,6 +617,9 @@ def __init__(self, wrapped):
"""
self.wrapped = wrapped

# Helps identify this solid through the use of an ID
self.label = ""

@classmethod
def makeShell(cls, listOfFaces):
return Shell(FreeCADPart.makeShell([i.obj for i in listOfFaces]))
Expand All @@ -614,6 +632,9 @@ def __init__(self, obj):
"""
self.wrapped = obj

# Helps identify this solid through the use of an ID
self.label = ""

@classmethod
def isSolid(cls, obj):
"""
Expand Down Expand Up @@ -915,6 +936,9 @@ def __init__(self, obj):
"""
self.wrapped = obj

# Helps identify this solid through the use of an ID
self.label = ""

def Center(self):
return self.Center()

Expand Down

0 comments on commit 007725a

Please sign in to comment.