Arch: remove trailing whitespace

This commit is contained in:
luz paz
2022-11-16 18:09:39 -05:00
committed by wwmayer
parent c3b38bda08
commit dc5b3cb495
10 changed files with 55 additions and 55 deletions

View File

@@ -285,7 +285,7 @@ class _Equipment(ArchComponent.Component):
self.addSketchArchFeatures(obj)
def addSketchArchFeatures(self,obj,linkObj=None,mode=None):
'''
'''
To add features in the SketchArch External Add-on, if present (https://github.com/paullee0/FreeCAD_SketchArch)
- import ArchSketchObject module, and
- set properties that are common to ArchObjects (including Links) and ArchSketch
@@ -348,7 +348,7 @@ class _Equipment(ArchComponent.Component):
self.executeSketchArchFeatures(obj)
def executeSketchArchFeatures(self, obj, linkObj=None, index=None, linkElement=None):
'''
'''
To execute features in the SketchArch External Add-on (https://github.com/paullee0/FreeCAD_SketchArch)
- import ArchSketchObject module, and
- execute features that are common to ArchObjects (including Links) and ArchSketch
@@ -377,7 +377,7 @@ class _Equipment(ArchComponent.Component):
# Execute features in the SketchArch External Add-on, if present
self.executeSketchArchFeatures(obj, linkObj)
def computeAreas(self,obj):
return

View File

@@ -243,17 +243,17 @@ class _Profile(Draft._DraftObject):
def __setstate__(self,state):
if isinstance(state,list):
self.Profile = state
def cleanProperties(self, obj):
'''Remove all Profile properties'''
obj.removeProperty("Width")
obj.removeProperty("Height")
obj.removeProperty("WebThickness")
obj.removeProperty("FlangeThickness")
obj.removeProperty("OutDiameter")
obj.removeProperty("Thickness")
obj.removeProperty("Thickness")
class _ProfileC(_Profile):
@@ -400,8 +400,8 @@ class _ProfileU(_Profile):
#p.reverse()
obj.Shape = p
obj.Placement = pl
class _ProfileL(_Profile):
'''A parametric L profile. Profile data: [width, height, thickness]'''
@@ -427,8 +427,8 @@ class _ProfileL(_Profile):
#p.reverse()
obj.Shape = p
obj.Placement = pl
class _ProfileT(_Profile):
'''A parametric T profile. Profile data: [width, height, web thickness, flange thickness]'''
@@ -457,7 +457,7 @@ class _ProfileT(_Profile):
#p.reverse()
obj.Shape = p
obj.Placement = pl
class ViewProviderProfile(Draft._ViewProviderDraft):
@@ -570,7 +570,7 @@ class ProfileTaskPanel:
self.Profile = self.currentpresets[idx]
def accept(self):
self.obj.Label = self.Profile[2]
if self.Profile:
if self.Profile[3]=="C":
@@ -589,7 +589,7 @@ class ProfileTaskPanel:
_ProfileT(self.obj, self.Profile)
else:
print("Profile not supported")
FreeCAD.ActiveDocument.recompute()
FreeCADGui.ActiveDocument.resetEdit()
return True

View File

@@ -21,12 +21,12 @@
#* *
#***************************************************************************
class ArchSketchObject:
def __init__(self, obj):
pass
class ArchSketch(ArchSketchObject):
def __init__(self, obj):
class ArchSketchObject:
def __init__(self, obj):
pass
#from ArchSketchObjectExt import ArchSketch # Not works
class ArchSketch(ArchSketchObject):
def __init__(self, obj):
pass
#from ArchSketchObjectExt import ArchSketch # Doesn't work

View File

@@ -82,7 +82,7 @@ def makeStairs(baseobj=None,length=None,width=None,height=None,steps=None,name="
obj.StructureThickness = 150
obj.DownSlabThickness = 150
obj.UpSlabThickness = 150
obj.RailingOffsetLeft = 60
obj.RailingOffsetRight = 60
obj.RailingHeightLeft = 900
@@ -418,7 +418,7 @@ class _Stairs(ArchComponent.Component):
if not "ConnectionEndStairsUp" in pl:
obj.addProperty("App::PropertyEnumeration","ConnectionEndStairsUp","Structure",QT_TRANSLATE_NOOP("App::Property","The type of connection between the end of the stairs and the upper floor slab"))
obj.ConnectionEndStairsUp = ["toFlightThickness","toSlabThickness"]
self.Type = "Stairs"
def onDocumentRestored(self,obj):
@@ -945,12 +945,12 @@ class _Stairs(ArchComponent.Component):
if not callByMakeStraightStairsWithLanding:
vBase = self.vbaseFollowLastSegment(obj, vBase)
obj.AbsTop = vBase
if not obj.Flight in ["HalfTurnLeft","HalfTurnRight"]:
vNose = DraftVecUtils.scaleTo(vLength,-abs(obj.Nosing.Value))
else:
vNose = Vector(0,0,0)
h = 0
l = 0
@@ -1028,7 +1028,7 @@ class _Stairs(ArchComponent.Component):
p2 = p1.add(Vector(0,0,-(abs(fHeight) - obj.TreadThickness.Value)))
p3 = p1.add(vLength)
p4 = p3.add(Vector(0,0,-(abs(fHeight) - obj.TreadThickness.Value)))
if obj.Structure == "Massive":
if obj.StructureThickness.Value:
struct = Part.Face(Part.makePolygon([p1,p2,p4,p3,p1]))
@@ -1105,12 +1105,12 @@ class _Stairs(ArchComponent.Component):
callByMakeStraightStairsWithLanding = False
else:
callByMakeStraightStairsWithLanding = True
if not downstartstairs:
downstartstairs = obj.ConnectionDownStartStairs
if not endstairsup:
endstairsup = obj.ConnectionEndStairsUp
v = DraftGeomUtils.vec(edge)
vLength = DraftVecUtils.scaleTo(v,float(edge.Length)/(numberofsteps-1))
vLength = Vector(vLength.x,vLength.y,0)
@@ -1205,7 +1205,7 @@ class _Stairs(ArchComponent.Component):
resHeight1 = obj.StructureThickness.Value/math.cos(a)
dh = s2 - float(h)/numberofsteps
resHeight2 = ((numberofsteps-1)*vHeight.Length) - dh
if endstairsup == "toFlightThickness":
lProfile.append(lProfile[-1].add(Vector(0,0,-resHeight1)))
resHeight2 = ((numberofsteps-1)*vHeight.Length)-(resHeight1+obj.TreadThickness.Value)
@@ -1218,10 +1218,10 @@ class _Stairs(ArchComponent.Component):
resLength2 = th / math.tan(a)
lProfile.append(lProfile[-1].add(Vector(0,0,obj.TreadThickness.Value - dh)))
lProfile.append(lProfile[-1].add(DraftVecUtils.scaleTo(vLength,resLength2)))
if s1 > resHeight1:
downstartstairs = "VerticalCut"
if downstartstairs == "VerticalCut":
dh = obj.DownSlabThickness.Value - resHeight1 - obj.TreadThickness.Value
resHeight2 = resHeight2 + obj.DownSlabThickness.Value - dh
@@ -1231,7 +1231,7 @@ class _Stairs(ArchComponent.Component):
temp_s1 = s1
if obj.UpSlabThickness.Value > resHeight1:
s1 = temp_s1
resHeight2 = resHeight2 + s1
resLength = (vLength.Length/vHeight.Length) * resHeight2
th = (resHeight1 - s1) + obj.TreadThickness.Value
@@ -1389,11 +1389,11 @@ class _Stairs(ArchComponent.Component):
self.makeStraightStairs(obj,Part.LineSegment(p3r,p4r).toShape(),obj.RiserHeight.Value,obj.UpSlabThickness.Value,obj.NumberOfSteps-landing,"HorizontalVerticalCut",None)
else:
self.makeStraightStairs(obj,Part.LineSegment(p3,p4).toShape(),obj.RiserHeight.Value,obj.UpSlabThickness.Value,obj.NumberOfSteps-landing,"HorizontalVerticalCut",None)
self.makeStraightStairs(obj,Part.LineSegment(p1,p2).toShape(),obj.DownSlabThickness.Value,obj.RiserHeight.Value,landing,None,'toSlabThickness')
else:
self.makeStraightStairs(obj,Part.LineSegment(p1,p2).toShape(),obj.DownSlabThickness.Value,obj.UpSlabThickness.Value,landing,None,None)
print (p1, p2)
if obj.Landings == "At center" and obj.Flight not in ["HalfTurnLeft", "HalfTurnRight"]:
print (p3, p4)

View File

@@ -87,7 +87,7 @@ def makeWindowPreset(windowtype,width,height,h1,h2,h3,w1,w2,o1,o2,placement=None
s.addConstraint(Sketcher.Constraint('Vertical',idx+7))
def simpleFrame(s,width,height,h1,h2,tol):
"creates a simple frame with constraints"
p1 = Vector(h1+tol,h1+tol,0)

View File

@@ -85,7 +85,7 @@ class FileLikeBuffer(object):
def seek(self,pos):
self.index = pos
if self.index < 0 or self.index > self.end:
raise FBufError("Invalid position in fbuf")
raise FBufError("Invalid position in fbuf")
def advance(self,n):
self.index += n
if self.index > self.end:
@@ -1615,7 +1615,7 @@ class CAMERA_NODE_TAG(ChunkBase):
"ROLL_TRACK_TAG roll_track")
class TARGET_NODE_TAG(ChunkBase):
tag = 0xB004
tag = 0xB004
single = ("NODE_ID node_id,"
"NODE_HDR node_hdr,"
"POS_TRACK_TAG pos_track")
@@ -1639,7 +1639,7 @@ class SPOTLIGHT_NODE_TAG(ChunkBase):
"ROLL_TRACK_TAG roll_track")
class L_TARGET_NODE_TAG(ChunkBase):
tag = 0xB006
tag = 0xB006
single = ("NODE_ID node_id,"
"NODE_HDR node_hdr,"
"POS_TRACK_TAG pos_track,"
@@ -1865,7 +1865,7 @@ def dump_3ds_file(filename,flo,arraylines=10,tight=False,recover=True):
otherwise raise an exception.
"""
check_magic = False
dom = read_3ds_file(filename,check_magic,tight,recover)
dump_3ds_chunk(dom,flo,arraylines)

View File

@@ -4,7 +4,7 @@
# All measures must be in millimeters
# Possible profile classes are:
# Possible profile classes are:
# C= Circular tube
# H= H- or I-profile
1 # Data structure:
4 # Possible profile classes are: # Possible profile classes are:
5 # C= Circular tube
6 # H= H- or I-profile
7 # R= Rectangular
8 # RH= Rectangular hollow
9 # U= U-profile
10 # Additional profile types must be implemented in ArchProfile.py first

View File

@@ -112,7 +112,7 @@ def createStructuralCurve(ifcfile, ifcbin, curve):
uid = ifcopenshell.guid.new
ownerHistory = ifcfile.by_type("IfcOwnerHistory")[0]
structContext = getStructuralContext(ifcfile)
cartPnt1 = ifcbin.createIfcCartesianPoint(tuple(curve.Vertexes[ 0].Point.multiply(scaling)))
cartPnt2 = ifcbin.createIfcCartesianPoint(tuple(curve.Vertexes[-1].Point.multiply(scaling)))
vertPnt1 = ifcfile.createIfcVertexPoint(cartPnt1)
@@ -148,11 +148,11 @@ def createStructuralMember(ifcfile, ifcbin, obj):
uid = ifcopenshell.guid.new
ownerHistory = ifcfile.by_type("IfcOwnerHistory")[0]
structContext = getStructuralContext(ifcfile)
# find edges to convert into structural members
edges = None
if Draft.getType(obj) not in ["Structure"]:
# for non structural elements
# for non structural elements
if ALLOW_LINEAR_OBJECTS and obj.isDerivedFrom("Part::Feature"):
# for objects created with Part workbench
if obj.Shape.Faces:
@@ -173,11 +173,11 @@ def createStructuralMember(ifcfile, ifcbin, obj):
edges = wire.Edges
if not edges:
return None
# OBJECT CLASSIFICATION by edge number
# Linear elements for edge_number = 1, Surface elements for edge_number > 1
# we don't care about curved edges just now...
if len(edges) == 1:
# LINEAR OBJECTS: beams, columns
# ATM limitations:
@@ -194,11 +194,11 @@ def createStructuralMember(ifcfile, ifcbin, obj):
vertPnt2 = ifcfile.createIfcVertexPoint(cartPnt2)
newEdge = ifcfile.createIfcEdge(vertPnt1, vertPnt2)
topologyRep = ifcfile.createIfcTopologyRepresentation(structContext, "Analysis", "Edge", (newEdge,))
prodDefShape = ifcfile.createIfcProductDefinitionShape(None, None, (topologyRep,))
prodDefShape = ifcfile.createIfcProductDefinitionShape(None, None, (topologyRep,))
# set local coordinate system
localPlacement = ifcbin.createIfcLocalPlacement()
localZAxis = ifcbin.createIfcDirection((0, 0, 1))
# create structural member
localZAxis = ifcbin.createIfcDirection((0, 0, 1))
# create structural member
if ifcfile.wrapped_data.schema_name() == "IFC2X3":
structuralMember = ifcfile.createIfcStructuralCurveMember(
uid(), ownerHistory, obj.Label, None, None, localPlacement, prodDefShape, "RIGID_JOINED_MEMBER")
@@ -211,8 +211,8 @@ def createStructuralMember(ifcfile, ifcbin, obj):
# SURFACE OBJECTS: slabs (horizontal, vertical, inclined)
# ATM limitations:
# - mo material properties are taken into account
# - walls don't work because they miss a node system
# -
# - walls don't work because they miss a node system
# -
# creates geometry
verts = [None for _ in range(len(edges))]
for i, edge in enumerate(edges):
@@ -227,7 +227,7 @@ def createStructuralMember(ifcfile, ifcbin, obj):
vertPnt1 = ifcfile.createIfcVertexPoint(cartPnt1)
vertPnt2 = ifcfile.createIfcVertexPoint(cartPnt2)
edge = ifcfile.createIfcEdge(vertPnt1, vertPnt2)
orientedEdges[i] = ifcfile.createIfcOrientedEdge(None, None, edge, True)
orientedEdges[i] = ifcfile.createIfcOrientedEdge(None, None, edge, True)
edgeLoop = ifcfile.createIfcEdgeLoop(tuple(orientedEdges))
# sets local coordinate system
localPlacement = ifcbin.createIfcLocalPlacement()
@@ -274,13 +274,13 @@ def createStructuralMember(ifcfile, ifcbin, obj):
else:
# just add the point, no other member using it yet
structural_nodes[vertCoord] = None
# check for existing connection curves
for edge in edges:
verts12 = tuple([edge.Vertexes[ 0].Point.x, edge.Vertexes[ 0].Point.y, edge.Vertexes[ 0].Point.z,
edge.Vertexes[-1].Point.x, edge.Vertexes[-1].Point.y, edge.Vertexes[-1].Point.z])
verts21 = tuple([edge.Vertexes[-1].Point.x, edge.Vertexes[-1].Point.y, edge.Vertexes[-1].Point.z,
edge.Vertexes[ 0].Point.x, edge.Vertexes[ 0].Point.y, edge.Vertexes[ 0].Point.z])
edge.Vertexes[ 0].Point.x, edge.Vertexes[ 0].Point.y, edge.Vertexes[ 0].Point.z])
verts12_in_curves = verts12 in structural_curves
verts21_in_curves = verts21 in structural_curves
if verts21_in_curves:

View File

@@ -105,7 +105,7 @@ def read(filename):
class SH3DHandler(xml.sax.ContentHandler):
def __init__(self,z):
super().__init__()
self.makeIndividualWalls = False
self.z = z

View File

@@ -863,7 +863,7 @@ def export( exportList, filename, colors = None, camera = None ):
data['baseFloat'] = baseFloat
html = html.replace('$data', json.dumps(data, separators=(',', ':')) ) # Shape Data
outfile = pythonopen(filename, "w")
outfile.write( html )
outfile.close()