Arch: misc improvements to materials and IFC

* Improved IFC export of curved surfaces
* Better icon for materials group
* Fixes in IFC export of materials
This commit is contained in:
Yorik van Havre
2015-04-19 16:34:36 -03:00
parent bba2dd581b
commit 4d630dbc32
7 changed files with 800 additions and 59 deletions

View File

@@ -423,7 +423,12 @@ def getShapeFromMesh(mesh,fast=True,tolerance=0.001,flat=False,cut=True):
pts = []
for pp in p:
pts.append(FreeCAD.Vector(pp[0],pp[1],pp[2]))
faces.append(Part.Face(Part.makePolygon(pts)))
try:
f = Part.Face(Part.makePolygon(pts))
except:
pass
else:
faces.append(f)
shell = Part.makeShell(faces)
solid = Part.Solid(shell)
solid = solid.removeSplitter()
@@ -509,6 +514,14 @@ def meshToShape(obj,mark=True,fast=True,tol=0.001,flat=False,cut=True):
return newobj
return None
def removeCurves(shape,tolerance=5):
'''removeCurves(shape,tolerance=5): replaces curved faces in a shape
with faceted segments'''
import Mesh
t = shape.cleaned().tessellate(tolerance)
m = Mesh.Mesh(t)
return getShapeFromMesh(m)
def removeShape(objs,mark=True):
'''removeShape(objs,mark=True): takes an arch object (wall or structure) built on a cubic shape, and removes
the inner shape, keeping its length, width and height as parameters. If mark is True, objects that cannot