Skip to content

Commit

Permalink
Arch: Fixed face normals in IFC export
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Apr 16, 2014
1 parent 8fdd049 commit dfe1c84
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/Mod/Arch/ArchCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,10 @@ def getTuples(data,scale=1,placement=None,normal=None):
data = Part.Wire(DraftGeomUtils.sortEdges(data.Wires[0].Edges))
verts = data.Vertexes
try:
if DraftVecUtils.angle(verts[1].Point,verts[0].Point,normal) >= 0:
c = data.CenterOfMass
v1 = verts[0].Point.sub(c)
v2 = verts[1].Point.sub(c)
if DraftVecUtils.angle(v2,v1,normal) >= 0:
# inverting verts order if the direction is couterclockwise
verts.reverse()
except:
Expand Down Expand Up @@ -666,9 +669,10 @@ def getBrepFacesData(obj,scale=1):
s = []
for face in obj.Shape.Faces:
f = []
f.append(getTuples(face.OuterWire,scale,normal=face.normalAt(0,0)))
for wire in face.Wires:
t = getTuples(wire,scale,normal=face.normalAt(0,0))
f.append(t)
if wire.hashCode() != face.OuterWire.hashCode():
f.append(getTuples(wire,scale,normal=DraftVecUtils.neg(face.normalAt(0,0))))
s.append(f)
sols.append(s)
return sols
Expand Down
2 changes: 1 addition & 1 deletion src/Tools/offlinedoc/buildpdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
# CONFIGURATION #################################################

INDEX = "Online_Help_Toc" # the start page from where to crawl the wiki
PDFCONVERTOR = 'firefox' # can be 'pisa', 'htmldoc', 'wkhtmltopdf' or 'firefox'
PDFCONVERTOR = 'wkhtmltopdf' # can be 'pisa', 'htmldoc', 'wkhtmltopdf' or 'firefox'
VERBOSE = True # set true to get output messages
INCLUDECOMMANDS = True # if true, the command pages of each workbench are included after each WB page
OVERWRITE = True # if true, pdf files are recreated even if already existing
Expand Down

0 comments on commit dfe1c84

Please sign in to comment.