have array in type of
Code: Select all
points=
[
[list of Vectors of outer border],
[list of Vectors of inner hole]
]
Code: Select all
class holedface:
def __init__(self, obj,points)
obj.Proxy = self
...
obj.addProperty("App::PropertyVectorList", "PointList", "Additional", "List of points as [array]")
obj.PointList = points
obj.setEditorMode("PointList",2)
class ViewProviderControlFace:
def __init__(self, obj):
...
def attach(self, obj):
...
def updateData(self, fp, prop):
"If a property of the handled feature has changed we have the chance to handle this here"
# fp is the handled feature, prop is the name of the property that has changed
#App.Console.PrintMessage("Change property: " + str(prop) + "\n")
if (str(prop) != "NormalDefault"):
if str(prop) != "Normal":
rot=fp.Placement.Rotation
fp.Normal = rot.multVec(fp.NormalDefault)
'''
if str(prop) != "NormalStart":
plac=fp.Placement.Base
fp.NormalStart = fp.NormalStartDefault + plac
fp.NormalEnd = fp.NormalEnd + plac
'''
if prop == "Shape":
s = fp.getPropertyByName("Shape")
self.data.point.setNum(len(fp.getPropertyByName("PointList")))
cnt=0
for i in s.Vertexes:
self.data.point.set1Value(cnt,i.X,i.Y,i.Z)
cnt=cnt+1
for numpoint in range(0,len(fp.getPropertyByName("PointList"))-1):
self.face.coordIndex.set1Value(numpoint,numpoint)
self.face.coordIndex.set1Value(numpoint+1,0)
self.face.coordIndex.set1Value(numpoint+2,-1)
tried make one list with adding additional edges connecting one point on outer border and on point on inner hole. but it is 2 edges with same vertices and finally this case works wrong (some part of face not show).