Black fix

This commit is contained in:
adam-urbanczyk
2020-09-09 11:48:08 +02:00
parent f53bd441aa
commit c8c21d7d11
2 changed files with 11 additions and 6 deletions

View File

@ -95,7 +95,9 @@ def setColor(l: TDF_Label, color: Color, tool):
tool.SetColor(l, color.wrapped, XCAFDoc_ColorType.XCAFDoc_ColorSurf) tool.SetColor(l, color.wrapped, XCAFDoc_ColorType.XCAFDoc_ColorSurf)
def toCAF(assy: AssemblyProtocol, coloredSTEP: bool = False) -> Tuple[TDF_Label, TDocStd_Document]: def toCAF(
assy: AssemblyProtocol, coloredSTEP: bool = False
) -> Tuple[TDF_Label, TDocStd_Document]:
# prepare a doc # prepare a doc
doc = TDocStd_Document(TCollection_ExtendedString("XmlOcaf")) doc = TDocStd_Document(TCollection_ExtendedString("XmlOcaf"))
@ -119,7 +121,7 @@ def toCAF(assy: AssemblyProtocol, coloredSTEP: bool = False) -> Tuple[TDF_Label,
subassy = tool.NewShape() subassy = tool.NewShape()
tool.AddComponent(subassy, lab, TopLoc_Location()) tool.AddComponent(subassy, lab, TopLoc_Location())
setName(subassy, k, tool) setName(subassy, k, tool)
# handle colors - this logic is needed for proper STEP export # handle colors - this logic is needed for proper STEP export
color = v.color color = v.color
tmp = v tmp = v

View File

@ -395,7 +395,7 @@ class TestCadObjects(BaseTest):
) )
def testLocation(self): def testLocation(self):
# Vector # Vector
loc1 = Location(Vector(0, 0, 1)) loc1 = Location(Vector(0, 0, 1))
@ -410,10 +410,13 @@ class TestCadObjects(BaseTest):
# gp_Trsf # gp_Trsf
T = gp_Trsf() T = gp_Trsf()
T.SetTranslation(gp_Vec(0,0,1)) T.SetTranslation(gp_Vec(0, 0, 1))
loc3 = Location(T) loc3 = Location(T)
assert( loc1.wrapped.Transformation().TranslationPart().Z() == loc3.wrapped.Transformation().TranslationPart().Z()) assert (
loc1.wrapped.Transformation().TranslationPart().Z()
== loc3.wrapped.Transformation().TranslationPart().Z()
)
if __name__ == "__main__": if __name__ == "__main__":