import os
from OCC.Core.IFSelect import IFSelect_RetDone
from OCC.Core.STEPCAFControl import STEPCAFControl_Reader
from OCC.Core.TCollection import TCollection_ExtendedString
from OCC.Core.TDocStd import TDocStd_Document
from OCC.Core.VrmlAPI import VrmlAPI_Writer
from OCC.Core.VrmlData import VrmlData_WorldInfo
from OCC.Core.XCAFDoc import XCAFDoc_ShapeTool, XCAFDoc_DocumentTool, XCAFDoc_DocumentTool_ShapeTool
from OCC.Core.XCAFApp import XCAFApp_Application_GetApplication
from OCC.Core.XCAFDoc import XCAFDoc_DocumentTool_ShapeTool, xcafdoc
from OCC.Core.BRep import BRep_Tool
from OCC.Core.TDF import TDF_LabelSequence, TDF_Label, TDF_ChildIterator, TDF_AttributeIterator, TDF_Tool, TDF_AttributeMap, TDF_Attribute, TDF_ChildIDIterator
from OCC.Core.TCollection import TCollection_AsciiString
from OCC.Core.TDataStd import TDataStd_TreeNode
from OCC.Core.Standard import Standard_GUID #, Standard_Handle
from OCC.Core.TNaming import TNaming_UsedShapes
from OCC.Extend.TopologyUtils import TopologyExplorer
from OCC.Extend.TopologyUtils import is_edge, is_wire, discretize_edge, discretize_wire
from OCC.Extend.DataExchange import read_step_file_with_names_colors, read_step_file
from OCC.Display.WebGl.x3dom_renderer import X3DExporter, X3DomRenderer
from OCC.Core.TopAbs import topabs
from OCC.Core.BRepMesh import BRepMesh_IncrementalMesh
import xml.etree.ElementTree as ET
from IPython.display import HTML
import x3d.x3d as X3D
import re
x3d.py package loaded, have fun with X3D Graphics!
#stp_filename = 'VentilatorAP203' #'as1_pe_203'
#stp_filename = 'as1-oc-214'
stp_filename = 'as1_pe_203'
stp_path = os.path.join('assets', 'step', stp_filename + '.stp')
# load the STEP file
doc = TDocStd_Document(TCollection_ExtendedString("pythonocc-doc"))
step_reader = STEPCAFControl_Reader()
step_reader.SetColorMode(True)
step_reader.SetLayerMode(True)
step_reader.SetNameMode(True)
step_reader.SetMatMode(True)
step_reader.SetGDTMode(True)
status = step_reader.ReadFile(stp_path)
if status == IFSelect_RetDone:
step_reader.Transfer(doc)
else:
raise IOError("STEP file could not be read.")
doc
<class 'TDocStd_Document'>
##Copyright 2018 Thomas Paviot (tpaviot@gmail.com)
##(C) 2020 Andreas Plesch
##
##This file is part of pythonOCC.
##
##pythonOCC is free software: you can redistribute it and/or modify
##it under the terms of the GNU Lesser General Public License as published by
##the Free Software Foundation, either version 3 of the License, or
##(at your option) any later version.
##
##pythonOCC is distributed in the hope that it will be useful,
##but WITHOUT ANY WARRANTY; without even the implied warranty of
##MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
##GNU Lesser General Public License for more details.
##
##You should have received a copy of the GNU Lesser General Public License
##along with pythonOCC. If not, see <http://www.gnu.org/licenses/>.
import os
from OCC.Core.TopoDS import TopoDS_Shape
from OCC.Core.BRepMesh import BRepMesh_IncrementalMesh
from OCC.Core.StlAPI import stlapi_Read, StlAPI_Writer
from OCC.Core.BRep import BRep_Builder
from OCC.Core.gp import gp_Pnt, gp_Dir, gp_Pnt2d
from OCC.Core.Bnd import Bnd_Box2d
from OCC.Core.TopoDS import TopoDS_Compound
from OCC.Core.IGESControl import IGESControl_Reader, IGESControl_Writer
from OCC.Core.STEPControl import STEPControl_Reader, STEPControl_Writer, STEPControl_AsIs
from OCC.Core.Interface import Interface_Static_SetCVal
from OCC.Core.IFSelect import IFSelect_RetDone, IFSelect_ItemsByEntity
from OCC.Core.TDocStd import TDocStd_Document
from OCC.Core.XCAFDoc import (XCAFDoc_DocumentTool_ShapeTool,
XCAFDoc_DocumentTool_ColorTool)
from OCC.Core.STEPCAFControl import STEPCAFControl_Reader
from OCC.Core.TDF import TDF_LabelSequence, TDF_Label
from OCC.Core.TCollection import TCollection_ExtendedString
from OCC.Core.Quantity import Quantity_Color, Quantity_TOC_RGB
from OCC.Core.TopLoc import TopLoc_Location
from OCC.Core.BRepBuilderAPI import BRepBuilderAPI_Transform
from OCC.Extend.TopologyUtils import (discretize_edge, get_sorted_hlr_edges,
list_of_shapes_to_compound)
try:
import svgwrite
HAVE_SVGWRITE = True
except ImportError:
HAVE_SVGWRITE = False
def read_step_file_with_names_colors(doc):
""" Returns list of tuples (topods_shape, label, color)
Use OCAF.
"""
output_shapes = {}
scene = []
visited = {}
DEFset = set()
# Get root assembly
shape_tool = XCAFDoc_DocumentTool_ShapeTool(doc.Main())
color_tool = XCAFDoc_DocumentTool_ColorTool(doc.Main())
locs = []
def _get_sub_shapes(lab, loc, parent):
#global cnt, lvl
#cnt += 1
#print("\n[%d] level %d, handling LABEL %s\n" % (cnt, lvl, _get_label_name(lab)))
#print()
#print(lab.DumpToString())
#print()
#print("Is Assembly :", shape_tool.IsAssembly(lab))
#print("Is Free :", shape_tool.IsFree(lab))
#print("Is Shape :", shape_tool.IsShape(lab))
#print("Is Compound :", shape_tool.IsCompound(lab))
#print("Is Component :", shape_tool.IsComponent(lab))
#print("Is SimpleShape :", shape_tool.IsSimpleShape(lab))
#print("Is Reference :", shape_tool.IsReference(lab))
#users = TDF_LabelSequence()
#users_cnt = shape_tool.GetUsers(lab, users)
#print("Nr Users :", users_cnt)
#print("Nb subshapes :", l_subss.Length())
#l_comps = TDF_LabelSequence()
#shape_tool.GetComponents(lab, l_comps)
#print("Nb components :", l_comps.Length())
#print()
name = lab.GetLabelName()
labelString = lab.EntryDumpToString()
if labelString in visited:
return
visited[labelString] = lab
if shape_tool.IsAssembly(lab):
node = {
'node' : 'Group',
'DEF' : labelString,
'name' : name,
'children' : []
}
l_c = TDF_LabelSequence()
shape_tool.GetComponents(lab, l_c)
for i in range(l_c.Length()):
label = l_c.Value(i+1)
print("Group Name DEF :", name, labelString )
if shape_tool.IsReference(label):
print("######## component label :", label.GetLabelName() )
loc = shape_tool.GetLocation(label)
print(" Transform loc DEF :", loc.HashCode(100))
trafo = {
'node' : 'Transform',
'DEF' : label.EntryDumpToString(),
'name' : 'reference location',
'transform' : loc,
'children': []
}
locs.append(loc)
print("loc chain depth :", len(locs))
label_reference = TDF_Label()
shape_tool.GetReferredShape(label, label_reference)
print("######## Transform USE to DEF ==> referenced label :", label_reference.GetLabelName() )
reference_entry = label_reference.EntryDumpToString()
if reference_entry not in DEFset:
DEFset.add(reference_entry)
_get_sub_shapes(label_reference, loc, trafo['children'])
else:
trafo['children'].append({
'node' : 'Transform',
'USE' : reference_entry,
'refname' : label_reference.GetLabelName()
})
locs.pop()
node['children'].append(trafo)
elif shape_tool.IsSimpleShape(lab):
print("Transform DEF Shape Name :", name, labelString )
shape = shape_tool.GetShape(lab)
#print(" all ass locs :", locs)
# loc = TopLoc_Location()
# for l in locs:
# loc = loc.Multiplied(l)
c = _set_color(lab, shape)
n = c.Name(c.Red(), c.Green(), c.Blue())
print(' instance color Name & RGB: ', n, c.Red(), c.Green(), c.Blue())
labloc = shape_tool.GetLocation(lab)
print(" Shape Transform: ", labloc.HashCode(100))
node = {
'node' : 'Transform',
'DEF' : labelString,
'name' : name,
}
#shape_disp = BRepBuilderAPI_Transform(shape, loc.Transformation()).Shape()
#shape_disp = shape
#if not shape_disp in output_shapes:
# output_shapes[shape_disp] = [lab.GetLabelName(), c]
##subshapes
l_subss = TDF_LabelSequence()
shape_tool.GetSubShapes(lab, l_subss)
if (l_subss.Length() == 0 and labloc.IsIdentity()): # does not need transform
node['node'] = 'Shape'
node['shape'] = lab
node['name'] = name+'-shape'
node['color'] = f"{c.Red()} {c.Green()} {c.Blue()}"
else: # needs grouping or has transform
node['transform'] = labloc
node['children'] = []
node['transformhash'] = labloc.HashCode(100)
node['children'].append({
'node' : 'Shape',
'shape' : lab,
'name' : name+'-shape',
'color' : f"{c.Red()} {c.Green()} {c.Blue()}"
})
for i in range(l_subss.Length()):
lab_subs = l_subss.Value(i+1)
print("######## Transform DEF simpleshape subshape label :", lab.GetLabelName())
shape_sub = shape_tool.GetShape(lab_subs)
c = _set_color(lab_subs, shape_sub)
n = c.Name(c.Red(), c.Green(), c.Blue())
print(' shape color Name & RGB: ', n, c.Red(), c.Green(), c.Blue())
subloc = shape_tool.GetLocation(lab_subs)
print(" subshape Transform: ", subloc.HashCode(100))
node['children'].append({
'node' : 'SubShape',
'shape' : lab_subs,
'DEF' : lab_subs.EntryDumpToString(),
'name' : lab_subs.GetLabelName()+'-subshape',
'color' : f"{c.Red()} {c.Green()} {c.Blue()}",
'trafo' : subloc
})
#shape_to_disp = BRepBuilderAPI_Transform(shape_sub, loc.Transformation()).Shape()
#shape_to_disp = shape_sub
# position the subshape to display
#if not shape_to_disp in output_shapes:
# output_shapes[shape_to_disp] = [lab_subs.GetLabelName(), c]
parent.append(node)
def _set_color(lab, shape):
c = Quantity_Color(0.5, 0.5, 0.5, Quantity_TOC_RGB) # default color
colorSet = False
if (color_tool.GetInstanceColor(shape, 0, c) or
color_tool.GetInstanceColor(shape, 1, c) or
color_tool.GetInstanceColor(shape, 2, c)):
colorSet = True
if not colorSet:
if (color_tool.GetColor(lab, 0, c) or
color_tool.GetColor(lab, 1, c) or
color_tool.GetColor(lab, 2, c)):
colorSet = True
if colorSet:
color_tool.SetInstanceColor(shape, 0, c)
color_tool.SetInstanceColor(shape, 1, c)
color_tool.SetInstanceColor(shape, 2, c)
return c
def _get_shapes():
labels = TDF_LabelSequence()
shape_tool.GetFreeShapes(labels)
#global cnt
#cnt += 1
print()
print("Number of shapes at root :", labels.Length())
print()
for i in range(labels.Length()):
root_item = labels.Value(i+1)
_get_sub_shapes(root_item, None, scene)
_get_shapes()
print('DONE')
return scene
scene=read_step_file_with_names_colors(doc)
Number of shapes at root : 1 Group Name DEF : AS1_PE_ASM 0:1:1:1 ######## component label : PLATE Transform loc DEF : 77 loc chain depth : 1 ######## Transform USE to DEF ==> referenced label : PLATE Group Name DEF : PLATE 0:1:1:2 ######## component label : =>[0:1:1:3] Transform loc DEF : 1 loc chain depth : 2 ######## Transform USE to DEF ==> referenced label : SOLID Transform DEF Shape Name : SOLID 0:1:1:3 instance color Name & RGB: 229 0.0 1.0 0.0 Shape Transform: 1 Group Name DEF : PLATE 0:1:1:2 ######## component label : =>[0:1:1:4] Transform loc DEF : 1 loc chain depth : 2 ######## Transform USE to DEF ==> referenced label : COMPOUND Transform DEF Shape Name : COMPOUND 0:1:1:4 instance color Name & RGB: 180 0.5 0.5 0.5 Shape Transform: 1 ######## Transform DEF simpleshape subshape label : COMPOUND shape color Name & RGB: 510 1.0 1.0 0.0 subshape Transform: 1 ######## Transform DEF simpleshape subshape label : COMPOUND shape color Name & RGB: 510 1.0 1.0 0.0 subshape Transform: 1 ######## Transform DEF simpleshape subshape label : COMPOUND shape color Name & RGB: 510 1.0 1.0 0.0 subshape Transform: 1 ######## Transform DEF simpleshape subshape label : COMPOUND shape color Name & RGB: 510 1.0 1.0 0.0 subshape Transform: 1 ######## Transform DEF simpleshape subshape label : COMPOUND shape color Name & RGB: 510 1.0 1.0 0.0 subshape Transform: 1 ######## Transform DEF simpleshape subshape label : COMPOUND shape color Name & RGB: 510 1.0 1.0 0.0 subshape Transform: 1 ######## Transform DEF simpleshape subshape label : COMPOUND shape color Name & RGB: 510 1.0 1.0 0.0 subshape Transform: 1 Group Name DEF : AS1_PE_ASM 0:1:1:1 ######## component label : L_BRACKET_ASSEMBLY Transform loc DEF : 93 loc chain depth : 1 ######## Transform USE to DEF ==> referenced label : L_BRACKET_ASSEMBLY_ASM Group Name DEF : L_BRACKET_ASSEMBLY_ASM 0:1:1:5 ######## component label : L-BRACKET Transform loc DEF : 17 loc chain depth : 2 ######## Transform USE to DEF ==> referenced label : L-BRACKET Group Name DEF : L-BRACKET 0:1:1:6 ######## component label : =>[0:1:1:7] Transform loc DEF : 1 loc chain depth : 3 ######## Transform USE to DEF ==> referenced label : SOLID Transform DEF Shape Name : SOLID 0:1:1:7 instance color Name & RGB: 510 1.0 1.0 0.0 Shape Transform: 1 Group Name DEF : L-BRACKET 0:1:1:6 ######## component label : =>[0:1:1:8] Transform loc DEF : 1 loc chain depth : 3 ######## Transform USE to DEF ==> referenced label : COMPOUND Transform DEF Shape Name : COMPOUND 0:1:1:8 instance color Name & RGB: 180 0.5 0.5 0.5 Shape Transform: 1 ######## Transform DEF simpleshape subshape label : COMPOUND shape color Name & RGB: 510 1.0 1.0 0.0 subshape Transform: 1 ######## Transform DEF simpleshape subshape label : COMPOUND shape color Name & RGB: 510 1.0 1.0 0.0 subshape Transform: 1 ######## Transform DEF simpleshape subshape label : COMPOUND shape color Name & RGB: 510 1.0 1.0 0.0 subshape Transform: 1 ######## Transform DEF simpleshape subshape label : COMPOUND shape color Name & RGB: 510 1.0 1.0 0.0 subshape Transform: 1 ######## Transform DEF simpleshape subshape label : COMPOUND shape color Name & RGB: 510 1.0 1.0 0.0 subshape Transform: 1 Group Name DEF : L_BRACKET_ASSEMBLY_ASM 0:1:1:5 ######## component label : NUT_BOLT_ASSEMBLY Transform loc DEF : 1 loc chain depth : 2 ######## Transform USE to DEF ==> referenced label : NUT_BOLT_ASSEMBLY_ASM Group Name DEF : NUT_BOLT_ASSEMBLY_ASM 0:1:1:9 ######## component label : BOLT Transform loc DEF : 13 loc chain depth : 3 ######## Transform USE to DEF ==> referenced label : BOLT Group Name DEF : BOLT 0:1:1:10 ######## component label : =>[0:1:1:11] Transform loc DEF : 1 loc chain depth : 4 ######## Transform USE to DEF ==> referenced label : SOLID Transform DEF Shape Name : SOLID 0:1:1:11 instance color Name & RGB: 22 0.0 0.0 1.0 Shape Transform: 1 Group Name DEF : BOLT 0:1:1:10 ######## component label : =>[0:1:1:12] Transform loc DEF : 1 loc chain depth : 4 ######## Transform USE to DEF ==> referenced label : COMPOUND Transform DEF Shape Name : COMPOUND 0:1:1:12 instance color Name & RGB: 180 0.5 0.5 0.5 Shape Transform: 1 ######## Transform DEF simpleshape subshape label : COMPOUND shape color Name & RGB: 510 1.0 1.0 0.0 subshape Transform: 1 Group Name DEF : NUT_BOLT_ASSEMBLY_ASM 0:1:1:9 ######## component label : NUT Transform loc DEF : 37 loc chain depth : 3 ######## Transform USE to DEF ==> referenced label : NUT Group Name DEF : NUT 0:1:1:13 ######## component label : =>[0:1:1:14] Transform loc DEF : 1 loc chain depth : 4 ######## Transform USE to DEF ==> referenced label : SOLID Transform DEF Shape Name : SOLID 0:1:1:14 instance color Name & RGB: 412 1.0 0.0 0.0 Shape Transform: 1 Group Name DEF : NUT 0:1:1:13 ######## component label : =>[0:1:1:15] Transform loc DEF : 1 loc chain depth : 4 ######## Transform USE to DEF ==> referenced label : COMPOUND Transform DEF Shape Name : COMPOUND 0:1:1:15 instance color Name & RGB: 180 0.5 0.5 0.5 Shape Transform: 1 ######## Transform DEF simpleshape subshape label : COMPOUND shape color Name & RGB: 510 1.0 1.0 0.0 subshape Transform: 1 Group Name DEF : L_BRACKET_ASSEMBLY_ASM 0:1:1:5 ######## component label : NUT_BOLT_ASSEMBLY Transform loc DEF : 13 loc chain depth : 2 ######## Transform USE to DEF ==> referenced label : NUT_BOLT_ASSEMBLY_ASM Group Name DEF : L_BRACKET_ASSEMBLY_ASM 0:1:1:5 ######## component label : NUT_BOLT_ASSEMBLY Transform loc DEF : 97 loc chain depth : 2 ######## Transform USE to DEF ==> referenced label : NUT_BOLT_ASSEMBLY_ASM Group Name DEF : AS1_PE_ASM 0:1:1:1 ######## component label : L_BRACKET_ASSEMBLY Transform loc DEF : 25 loc chain depth : 1 ######## Transform USE to DEF ==> referenced label : L_BRACKET_ASSEMBLY_ASM Group Name DEF : AS1_PE_ASM 0:1:1:1 ######## component label : ROD Transform loc DEF : 93 loc chain depth : 1 ######## Transform USE to DEF ==> referenced label : ROD_ASM Group Name DEF : ROD_ASM 0:1:1:16 ######## component label : ROD Transform loc DEF : 93 loc chain depth : 2 ######## Transform USE to DEF ==> referenced label : ROD Group Name DEF : ROD 0:1:1:17 ######## component label : =>[0:1:1:18] Transform loc DEF : 1 loc chain depth : 3 ######## Transform USE to DEF ==> referenced label : SOLID Transform DEF Shape Name : SOLID 0:1:1:18 instance color Name & RGB: 22 0.0 0.0 1.0 Shape Transform: 1 Group Name DEF : ROD 0:1:1:17 ######## component label : =>[0:1:1:19] Transform loc DEF : 1 loc chain depth : 3 ######## Transform USE to DEF ==> referenced label : COMPOUND Transform DEF Shape Name : COMPOUND 0:1:1:19 instance color Name & RGB: 180 0.5 0.5 0.5 Shape Transform: 1 ######## Transform DEF simpleshape subshape label : COMPOUND shape color Name & RGB: 510 1.0 1.0 0.0 subshape Transform: 1 Group Name DEF : ROD_ASM 0:1:1:16 ######## component label : NUT Transform loc DEF : 69 loc chain depth : 2 ######## Transform USE to DEF ==> referenced label : NUT Group Name DEF : ROD_ASM 0:1:1:16 ######## component label : NUT Transform loc DEF : 61 loc chain depth : 2 ######## Transform USE to DEF ==> referenced label : NUT DONE
compoundlab=(scene[0]['children'][3]['children'][0]['children'][0]['children'][0]['children'][1]['children'][0]['children'][0]['shape'])
scene
[{'node': 'Group', 'DEF': '0:1:1:1', 'name': 'AS1_PE_ASM', 'children': [{'node': 'Transform', 'DEF': '0:1:1:1:1', 'name': 'reference location', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Group', 'DEF': '0:1:1:2', 'name': 'PLATE', 'children': [{'node': 'Transform', 'DEF': '0:1:1:2:1', 'name': 'reference location', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Shape', 'DEF': '0:1:1:3', 'name': 'SOLID-shape', 'shape': <class 'TDF_Label'>, 'color': '0.0 1.0 0.0'}]}, {'node': 'Transform', 'DEF': '0:1:1:2:2', 'name': 'reference location', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Transform', 'DEF': '0:1:1:4', 'name': 'COMPOUND', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Shape', 'shape': <class 'TDF_Label'>, 'name': 'COMPOUND-shape', 'color': '0.5 0.5 0.5'}, {'node': 'SubShape', 'shape': <class 'TDF_Label'; Null>, 'DEF': '0:1:1:4:1', 'name': '-subshape', 'color': '1.0 1.0 0.0', 'trafo': <class 'TopLoc_Location'>}, {'node': 'SubShape', 'shape': <class 'TDF_Label'; Null>, 'DEF': '0:1:1:4:2', 'name': '-subshape', 'color': '1.0 1.0 0.0', 'trafo': <class 'TopLoc_Location'>}, {'node': 'SubShape', 'shape': <class 'TDF_Label'; Null>, 'DEF': '0:1:1:4:3', 'name': '-subshape', 'color': '1.0 1.0 0.0', 'trafo': <class 'TopLoc_Location'>}, {'node': 'SubShape', 'shape': <class 'TDF_Label'; Null>, 'DEF': '0:1:1:4:4', 'name': '-subshape', 'color': '1.0 1.0 0.0', 'trafo': <class 'TopLoc_Location'>}, {'node': 'SubShape', 'shape': <class 'TDF_Label'>, 'DEF': '0:1:1:4:5', 'name': '-subshape', 'color': '1.0 1.0 0.0', 'trafo': <class 'TopLoc_Location'>}, {'node': 'SubShape', 'shape': <class 'TDF_Label'; Null>, 'DEF': '0:1:1:4:6', 'name': '-subshape', 'color': '1.0 1.0 0.0', 'trafo': <class 'TopLoc_Location'>}, {'node': 'SubShape', 'shape': <class 'TDF_Label'; Null>, 'DEF': '0:1:1:4:7', 'name': '-subshape', 'color': '1.0 1.0 0.0', 'trafo': <class 'TopLoc_Location'>}], 'transformhash': 1}]}]}]}, {'node': 'Transform', 'DEF': '0:1:1:1:2', 'name': 'reference location', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Group', 'DEF': '0:1:1:5', 'name': 'L_BRACKET_ASSEMBLY_ASM', 'children': [{'node': 'Transform', 'DEF': '0:1:1:5:1', 'name': 'reference location', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Group', 'DEF': '0:1:1:6', 'name': 'L-BRACKET', 'children': [{'node': 'Transform', 'DEF': '0:1:1:6:1', 'name': 'reference location', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Shape', 'DEF': '0:1:1:7', 'name': 'SOLID-shape', 'shape': <class 'TDF_Label'>, 'color': '1.0 1.0 0.0'}]}, {'node': 'Transform', 'DEF': '0:1:1:6:2', 'name': 'reference location', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Transform', 'DEF': '0:1:1:8', 'name': 'COMPOUND', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Shape', 'shape': <class 'TDF_Label'>, 'name': 'COMPOUND-shape', 'color': '0.5 0.5 0.5'}, {'node': 'SubShape', 'shape': <class 'TDF_Label'; Null>, 'DEF': '0:1:1:8:1', 'name': '-subshape', 'color': '1.0 1.0 0.0', 'trafo': <class 'TopLoc_Location'>}, {'node': 'SubShape', 'shape': <class 'TDF_Label'; Null>, 'DEF': '0:1:1:8:2', 'name': '-subshape', 'color': '1.0 1.0 0.0', 'trafo': <class 'TopLoc_Location'>}, {'node': 'SubShape', 'shape': <class 'TDF_Label'; Null>, 'DEF': '0:1:1:8:3', 'name': '-subshape', 'color': '1.0 1.0 0.0', 'trafo': <class 'TopLoc_Location'>}, {'node': 'SubShape', 'shape': <class 'TDF_Label'; Null>, 'DEF': '0:1:1:8:4', 'name': '-subshape', 'color': '1.0 1.0 0.0', 'trafo': <class 'TopLoc_Location'>}, {'node': 'SubShape', 'shape': <class 'TDF_Label'; Null>, 'DEF': '0:1:1:8:5', 'name': '-subshape', 'color': '1.0 1.0 0.0', 'trafo': <class 'TopLoc_Location'>}], 'transformhash': 1}]}]}]}, {'node': 'Transform', 'DEF': '0:1:1:5:2', 'name': 'reference location', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Group', 'DEF': '0:1:1:9', 'name': 'NUT_BOLT_ASSEMBLY_ASM', 'children': [{'node': 'Transform', 'DEF': '0:1:1:9:1', 'name': 'reference location', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Group', 'DEF': '0:1:1:10', 'name': 'BOLT', 'children': [{'node': 'Transform', 'DEF': '0:1:1:10:1', 'name': 'reference location', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Shape', 'DEF': '0:1:1:11', 'name': 'SOLID-shape', 'shape': <class 'TDF_Label'>, 'color': '0.0 0.0 1.0'}]}, {'node': 'Transform', 'DEF': '0:1:1:10:2', 'name': 'reference location', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Transform', 'DEF': '0:1:1:12', 'name': 'COMPOUND', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Shape', 'shape': <class 'TDF_Label'>, 'name': 'COMPOUND-shape', 'color': '0.5 0.5 0.5'}, {'node': 'SubShape', 'shape': <class 'TDF_Label'; Null>, 'DEF': '0:1:1:12:1', 'name': '-subshape', 'color': '1.0 1.0 0.0', 'trafo': <class 'TopLoc_Location'>}], 'transformhash': 1}]}]}]}, {'node': 'Transform', 'DEF': '0:1:1:9:2', 'name': 'reference location', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Group', 'DEF': '0:1:1:13', 'name': 'NUT', 'children': [{'node': 'Transform', 'DEF': '0:1:1:13:1', 'name': 'reference location', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Shape', 'DEF': '0:1:1:14', 'name': 'SOLID-shape', 'shape': <class 'TDF_Label'>, 'color': '1.0 0.0 0.0'}]}, {'node': 'Transform', 'DEF': '0:1:1:13:2', 'name': 'reference location', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Transform', 'DEF': '0:1:1:15', 'name': 'COMPOUND', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Shape', 'shape': <class 'TDF_Label'>, 'name': 'COMPOUND-shape', 'color': '0.5 0.5 0.5'}, {'node': 'SubShape', 'shape': <class 'TDF_Label'; Null>, 'DEF': '0:1:1:15:1', 'name': '-subshape', 'color': '1.0 1.0 0.0', 'trafo': <class 'TopLoc_Location'>}], 'transformhash': 1}]}]}]}]}]}, {'node': 'Transform', 'DEF': '0:1:1:5:3', 'name': 'reference location', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Transform', 'USE': '0:1:1:9', 'refname': 'NUT_BOLT_ASSEMBLY_ASM'}]}, {'node': 'Transform', 'DEF': '0:1:1:5:4', 'name': 'reference location', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Transform', 'USE': '0:1:1:9', 'refname': 'NUT_BOLT_ASSEMBLY_ASM'}]}]}]}, {'node': 'Transform', 'DEF': '0:1:1:1:3', 'name': 'reference location', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Transform', 'USE': '0:1:1:5', 'refname': 'L_BRACKET_ASSEMBLY_ASM'}]}, {'node': 'Transform', 'DEF': '0:1:1:1:4', 'name': 'reference location', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Group', 'DEF': '0:1:1:16', 'name': 'ROD_ASM', 'children': [{'node': 'Transform', 'DEF': '0:1:1:16:1', 'name': 'reference location', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Group', 'DEF': '0:1:1:17', 'name': 'ROD', 'children': [{'node': 'Transform', 'DEF': '0:1:1:17:1', 'name': 'reference location', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Shape', 'DEF': '0:1:1:18', 'name': 'SOLID-shape', 'shape': <class 'TDF_Label'>, 'color': '0.0 0.0 1.0'}]}, {'node': 'Transform', 'DEF': '0:1:1:17:2', 'name': 'reference location', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Transform', 'DEF': '0:1:1:19', 'name': 'COMPOUND', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Shape', 'shape': <class 'TDF_Label'>, 'name': 'COMPOUND-shape', 'color': '0.5 0.5 0.5'}, {'node': 'SubShape', 'shape': <class 'TDF_Label'>, 'DEF': '0:1:1:19:1', 'name': '-subshape', 'color': '1.0 1.0 0.0', 'trafo': <class 'TopLoc_Location'>}], 'transformhash': 1}]}]}]}, {'node': 'Transform', 'DEF': '0:1:1:16:2', 'name': 'reference location', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Transform', 'USE': '0:1:1:13', 'refname': 'NUT'}]}, {'node': 'Transform', 'DEF': '0:1:1:16:3', 'name': 'reference location', 'transform': <class 'TopLoc_Location'>, 'children': [{'node': 'Transform', 'USE': '0:1:1:13', 'refname': 'NUT'}]}]}]}]}]
shape_tool = XCAFDoc_DocumentTool_ShapeTool(doc.Main())
help(shape_tool.GetShape(compoundlab))
Help on TopoDS_Compound in module OCC.Core.TopoDS object: class TopoDS_Compound(TopoDS_Shape) | TopoDS_Compound(*args) | | Method resolution order: | TopoDS_Compound | TopoDS_Shape | builtins.object | | Methods defined here: | | __init__(self, *args) | * Constructs an Undefined Compound. | :rtype: None | | __repr__ = _dumps_object(klass) | Overwrite default string output for any wrapped object. | By default, __repr__ method returns something like: | <OCC.Core.TopoDS.TopoDS_Shape; proxy of <Swig Object of type 'TopoDS_Shape *' at 0x02BB0758> > | This is too much verbose. | We prefer : | <class 'gp_Pnt'> | or | <class 'TopoDS_Shape'> | | ---------------------------------------------------------------------- | Static methods defined here: | | __swig_destroy__ = delete_TopoDS_Compound(...) | delete_TopoDS_Compound(TopoDS_Compound self) | | ---------------------------------------------------------------------- | Data descriptors defined here: | | thisown | The membership flag | | ---------------------------------------------------------------------- | Methods inherited from TopoDS_Shape: | | Checked = TopoDS_Shape_Checked(...) | * Returns the checked flag. | :rtype: bool* Sets the checked flag. | :param theIsChecked: | :type theIsChecked: bool | :rtype: None | | Closed = TopoDS_Shape_Closed(...) | * Returns the closedness flag. | :rtype: bool* Sets the closedness flag. | :param theIsClosed: | :type theIsClosed: bool | :rtype: None | | Complement = TopoDS_Shape_Complement(...) | * Complements the orientation, using the Complement method from the TopAbs package. | :rtype: None | | Complemented = TopoDS_Shape_Complemented(...) | * Returns a shape similar to <self> with the orientation complemented, using the Complement method from the TopAbs package. | :rtype: TopoDS_Shape | | Compose = TopoDS_Shape_Compose(...) | * Updates the Shape Orientation by composition with theOrient, using the Compose method from the TopAbs package. | :param theOrient: | :type theOrient: TopAbs_Orientation | :rtype: None | | Composed = TopoDS_Shape_Composed(...) | * Returns a shape similar to <self> with the orientation composed with theOrient, using the Compose method from the TopAbs package. | :param theOrient: | :type theOrient: TopAbs_Orientation | :rtype: TopoDS_Shape | | Convex = TopoDS_Shape_Convex(...) | * Returns the convexness flag. | :rtype: bool* Sets the convexness flag. | :param theIsConvex: | :type theIsConvex: bool | :rtype: None | | DumpJsonToString = TopoDS_Shape_DumpJsonToString(...) | DumpJsonToString(TopoDS_Shape self, int depth=-1) -> std::string | | EmptyCopied = TopoDS_Shape_EmptyCopied(...) | * Returns a new Shape with the same Orientation and Location and a new TShape with the same geometry and no sub-shapes. | :rtype: TopoDS_Shape | | EmptyCopy = TopoDS_Shape_EmptyCopy(...) | * Replace <self> by a new Shape with the same Orientation and Location and a new TShape with the same geometry and no sub-shapes. | :rtype: None | | Free = TopoDS_Shape_Free(...) | * Returns the free flag. | :rtype: bool* Sets the free flag. | :param theIsFree: | :type theIsFree: bool | :rtype: None | | HashCode = TopoDS_Shape_HashCode(...) | * Returns a hashed value denoting <self>. This value is in the range [1, theUpperBound]. It is computed from the TShape and the Location. The Orientation is not used. @param theUpperBound the upper bound of the range a computing hash code must be within returns a computed hash code, in the range [1, theUpperBound] | :param theUpperBound: | :type theUpperBound: int | :rtype: int | | Infinite = TopoDS_Shape_Infinite(...) | * Returns the infinity flag. | :rtype: bool* Sets the infinity flag. | :param theIsInfinite: | :type theIsInfinite: bool | :rtype: None | | IsEqual = TopoDS_Shape_IsEqual(...) | * Returns True if two shapes are equal, i.e. if they share the same TShape with the same Locations and Orientations. | :param theOther: | :type theOther: TopoDS_Shape | :rtype: bool | | IsNotEqual = TopoDS_Shape_IsNotEqual(...) | * Negation of the IsEqual method. | :param theOther: | :type theOther: TopoDS_Shape | :rtype: bool | | IsNull = TopoDS_Shape_IsNull(...) | * Returns true if this shape is null. In other words, it references no underlying shape with the potential to be given a location and an orientation. | :rtype: bool | | IsPartner = TopoDS_Shape_IsPartner(...) | * Returns True if two shapes are partners, i.e. if they share the same TShape. Locations and Orientations may differ. | :param theOther: | :type theOther: TopoDS_Shape | :rtype: bool | | IsSame = TopoDS_Shape_IsSame(...) | * Returns True if two shapes are same, i.e. if they share the same TShape with the same Locations. Orientations may differ. | :param theOther: | :type theOther: TopoDS_Shape | :rtype: bool | | Located = TopoDS_Shape_Located(...) | * Returns a shape similar to <self> with the local coordinate system set to <Loc>. | :param theLoc: | :type theLoc: TopLoc_Location | :rtype: TopoDS_Shape | | Location = TopoDS_Shape_Location(...) | * Returns the shape local coordinate system. | :rtype: TopLoc_Location* Sets the shape local coordinate system. | :param theLoc: | :type theLoc: TopLoc_Location | :rtype: None | | Locked = TopoDS_Shape_Locked(...) | * Returns the locked flag. | :rtype: bool* Sets the locked flag. | :param theIsLocked: | :type theIsLocked: bool | :rtype: None | | Modified = TopoDS_Shape_Modified(...) | * Returns the modification flag. | :rtype: bool* Sets the modification flag. | :param theIsModified: | :type theIsModified: bool | :rtype: None | | Move = TopoDS_Shape_Move(...) | * Multiplies the Shape location by thePosition. | :param thePosition: | :type thePosition: TopLoc_Location | :rtype: None | | Moved = TopoDS_Shape_Moved(...) | * Returns a shape similar to <self> with a location multiplied by thePosition. | :param thePosition: | :type thePosition: TopLoc_Location | :rtype: TopoDS_Shape | | NbChildren = TopoDS_Shape_NbChildren(...) | * Returns the number of direct sub-shapes (children). @sa TopoDS_Iterator for accessing sub-shapes | :rtype: int | | Nullify = TopoDS_Shape_Nullify(...) | * Destroys the reference to the underlying shape stored in this shape. As a result, this shape becomes null. | :rtype: None | | Orientable = TopoDS_Shape_Orientable(...) | * Returns the orientability flag. | :rtype: bool* Sets the orientability flag. | :param theIsOrientable: | :type theIsOrientable: bool | :rtype: None | | Orientation = TopoDS_Shape_Orientation(...) | * Returns the shape orientation. | :rtype: TopAbs_Orientation* Sets the shape orientation. | :param theOrient: | :type theOrient: TopAbs_Orientation | :rtype: None | | Oriented = TopoDS_Shape_Oriented(...) | * Returns a shape similar to <self> with the orientation set to <Or>. | :param theOrient: | :type theOrient: TopAbs_Orientation | :rtype: TopoDS_Shape | | Reverse = TopoDS_Shape_Reverse(...) | * Reverses the orientation, using the Reverse method from the TopAbs package. | :rtype: None | | Reversed = TopoDS_Shape_Reversed(...) | * Returns a shape similar to <self> with the orientation reversed, using the Reverse method from the TopAbs package. | :rtype: TopoDS_Shape | | ShapeType = TopoDS_Shape_ShapeType(...) | * Returns the value of the TopAbs_ShapeEnum enumeration that corresponds to this shape, for example VERTEX, EDGE, and so on. Exceptions Standard_NullObject if this shape is null. | :rtype: TopAbs_ShapeEnum | | TShape = TopoDS_Shape_TShape(...) | * Returns a handle to the actual shape implementation. | :rtype: opencascade::handle<TopoDS_TShape>:param theTShape: | :type theTShape: TopoDS_TShape | :rtype: None | | __eq__(self, right) | Return self==value. | | __eq_wrapper__ = TopoDS_Shape___eq_wrapper__(...) | __eq_wrapper__(TopoDS_Shape self, TopoDS_Shape other) -> bool | | __getstate__(self) | | __hash__ = TopoDS_Shape___hash__(...) | __hash__(TopoDS_Shape self) -> Standard_Integer | | __setstate__(self, state) | | ---------------------------------------------------------------------- | Data descriptors inherited from TopoDS_Shape: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined)
print(compoundlab.DumpToString())
help(compoundlab)
0:1:1:19 NOT imported; NOT modified; NO attribute modified; has 5 attributes. TNaming_NamedShape Trans. 0; Valid; ID = c4ef4200-568f-11d1-8940-080009dc3333 XCAFDoc_ShapeMapTool Trans. 0; Valid; ID = 3b913f4d-4a82-44ef-a0bf-9e01e9ff317a TDataStd_Name Trans. 0; Valid; ID = 2a96b608-ec8b-11d0-bee7-080009dc3333 TDataStd_TreeNode Trans. 0; Valid; ID = 5b896afe-3adf-11d4-b9b7-0060b0ee281b TDF_TagSource Trans. 0; Valid; ID = 2a96b611-ec8b-11d0-bee7-080009dc3333 Help on TDF_Label in module OCC.Core.TDF object: class TDF_Label(builtins.object) | TDF_Label(*args) | | Methods defined here: | | AddAttribute = TDF_Label_AddAttribute(...) | * Adds an Attribute to the current label. Raises if there is already one. | :param anAttribute: | :type anAttribute: TDF_Attribute | :param append: default value is Standard_True | :type append: bool | :rtype: None | | AttributesModified = TDF_Label_AttributesModified(...) | * Returns true if <self> owns attributes not yet available in transaction 0. It means at least one attribute is new, modified or deleted. | :rtype: bool | | Data = TDF_Label_Data(...) | * Returns the Data owning <self>. | :rtype: opencascade::handle<TDF_Data> | | Depth = TDF_Label_Depth(...) | * Returns the depth of the label in the data framework. This corresponds to the number of fathers which this label has, and is used in determining whether a label is root, null or equivalent to another label. Exceptions: Standard_NullObject if this label is null. This is because a null object can have no depth. | :rtype: int | | DumpToString = TDF_Label_DumpToString(...) | DumpToString(TDF_Label self) -> std::string | | EntryDumpToString = TDF_Label_EntryDumpToString(...) | EntryDumpToString(TDF_Label self) -> std::string | | ExtendedDump = TDF_Label_ExtendedDump(...) | * Dumps the label on <aStream> and its attributes rank in <aMap> if their IDs are kept by <IDFilter>. | :param anOS: | :type anOS: Standard_OStream | :param aFilter: | :type aFilter: TDF_IDFilter | :param aMap: | :type aMap: TDF_AttributeIndexedMap | :rtype: None | | Father = TDF_Label_Father(...) | * Returns the label father. This label may be null if the label is root. | :rtype: TDF_Label | | FindAttribute = TDF_Label_FindAttribute(...) | * Finds an attribute of the current label, according to <anID>. If anAttribute is not a valid one, false is returned. //! The method returns True if found, False otherwise. //! A removed attribute cannot be found. | :param anID: | :type anID: Standard_GUID | :param anAttribute: | :type anAttribute: TDF_Attribute | :rtype: bool* Finds an attribute of the current label, according to <anID> and <aTransaction>. This attribute has/had to be a valid one for the given transaction index . So, this attribute is not necessary a valid one. //! The method returns True if found, False otherwise. //! A removed attribute cannot be found nor a backuped attribute of a removed one. | :param anID: | :type anID: Standard_GUID | :param aTransaction: | :type aTransaction: int | :param anAttribute: | :type anAttribute: TDF_Attribute | :rtype: bool | | FindChild = TDF_Label_FindChild(...) | * Finds a child label having <aTag> as tag. Creates The tag aTag identifies the label which will be the parent. If create is true and no child label is found, a new one is created. Example: //creating a label with tag 10 at Root TDF_Label lab1 = aDF->Root().FindChild(10); //creating labels 7 and 2 on label 10 TDF_Label lab2 = lab1.FindChild(7); TDF_Label lab3 = lab1.FindChild(2); | :param aTag: | :type aTag: int | :param create: default value is Standard_True | :type create: bool | :rtype: TDF_Label | | ForgetAllAttributes = TDF_Label_ForgetAllAttributes(...) | * Forgets all the attributes. Does it on also on the sub-labels if <clearChildren> is set to true. Of course, this method is compatible with Transaction & Delta mecanisms. | :param clearChildren: default value is Standard_True | :type clearChildren: bool | :rtype: None | | ForgetAttribute = TDF_Label_ForgetAttribute(...) | * Forgets an Attribute from the current label, setting its forgotten status true and its valid status false. Raises if the attribute is not in the structure. | :param anAttribute: | :type anAttribute: TDF_Attribute | :rtype: None* Forgets the Attribute of GUID <aguid> from the current label . If the attribute doesn't exist returns False. Otherwise returns True. | :param aguid: | :type aguid: Standard_GUID | :rtype: bool | | GetLabelName = TDF_Label_GetLabelName(...) | Returns the label name | | HasAttribute = TDF_Label_HasAttribute(...) | * Returns true if this label has at least one attribute. | :rtype: bool | | HasChild = TDF_Label_HasChild(...) | * Returns true if this label has at least one child. | :rtype: bool | | HasGreaterNode = TDF_Label_HasGreaterNode(...) | * Returns true if node address of <self> is greater than <otherLabel> one. Used to quickly sort labels (not on entry criterion). //! -C++: inline | :param otherLabel: | :type otherLabel: TDF_Label | :rtype: bool | | HasLowerNode = TDF_Label_HasLowerNode(...) | * Returns true if node address of <self> is lower than <otherLabel> one. Used to quickly sort labels (not on entry criterion). //! -C++: inline | :param otherLabel: | :type otherLabel: TDF_Label | :rtype: bool | | Imported = TDF_Label_Imported(...) | * Sets or unsets <self> and all its descendants as imported label, according to <aStatus>. | :param aStatus: | :type aStatus: bool | :rtype: None | | IsAttribute = TDF_Label_IsAttribute(...) | * Returns true if <self> owns an attribute with <anID> as ID. | :param anID: | :type anID: Standard_GUID | :rtype: bool | | IsDescendant = TDF_Label_IsDescendant(...) | * Returns True if <self> is a descendant of <aLabel>. Attention: every label is its own descendant. | :param aLabel: | :type aLabel: TDF_Label | :rtype: bool | | IsDifferent = TDF_Label_IsDifferent(...) | :param aLabel: | :type aLabel: TDF_Label | :rtype: bool | | IsEqual = TDF_Label_IsEqual(...) | * Returns True if the <aLabel> is equal to me (same LabelNode*). | :param aLabel: | :type aLabel: TDF_Label | :rtype: bool | | IsImported = TDF_Label_IsImported(...) | * Returns True if the <aLabel> is imported. | :rtype: bool | | IsNull = TDF_Label_IsNull(...) | * Returns True if the <aLabel> is null, i.e. it has not been included in the data framework. | :rtype: bool | | IsRoot = TDF_Label_IsRoot(...) | :rtype: bool | | MayBeModified = TDF_Label_MayBeModified(...) | * Returns true if <self> or a DESCENDANT of <self> owns attributes not yet available in transaction 0. It means at least one of their attributes is new, modified or deleted. | :rtype: bool | | NbAttributes = TDF_Label_NbAttributes(...) | * Returns the number of attributes. | :rtype: int | | NbChildren = TDF_Label_NbChildren(...) | * Returns the number of children. | :rtype: int | | NewChild = TDF_Label_NewChild(...) | * Create a new child label of me using autoamtic delivery tags provided by TagSource. | :rtype: TDF_Label | | Nullify = TDF_Label_Nullify(...) | * Nullifies the label. | :rtype: None | | ResumeAttribute = TDF_Label_ResumeAttribute(...) | * Undo Forget action, setting its forgotten status false and its valid status true. Raises if the attribute is not in the structure. | :param anAttribute: | :type anAttribute: TDF_Attribute | :rtype: None | | Root = TDF_Label_Root(...) | * Returns the root label Root of the data structure. This has a depth of 0. Exceptions: Standard_NullObject if this label is null. This is because a null object can have no depth. | :rtype: TDF_Label | | Tag = TDF_Label_Tag(...) | * Returns the tag of the label. This is the integer assigned randomly to a label in a data framework. This integer is used to identify this label in an entry. | :rtype: int | | Transaction = TDF_Label_Transaction(...) | * Returns the current transaction index. | :rtype: int | | __eq__(self, right) | Return self==value. | | __eq_wrapper__ = TDF_Label___eq_wrapper__(...) | __eq_wrapper__(TDF_Label self, TDF_Label other) -> bool | | __init__(self, *args) | * Constructs an empty label object. | :rtype: None | | __repr__ = _dumps_object(klass) | Overwrite default string output for any wrapped object. | By default, __repr__ method returns something like: | <OCC.Core.TopoDS.TopoDS_Shape; proxy of <Swig Object of type 'TopoDS_Shape *' at 0x02BB0758> > | This is too much verbose. | We prefer : | <class 'gp_Pnt'> | or | <class 'TopoDS_Shape'> | | ---------------------------------------------------------------------- | Static methods defined here: | | __swig_destroy__ = delete_TDF_Label(...) | delete_TDF_Label(TDF_Label self) | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined) | | thisown | The membership flag | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | __hash__ = None