These are example URLs for STEP AP203 files. Copy and paste into the source_url variable below.
source_url = "https://spri-open-resources.s3.us-east-2.amazonaws.com/nist_ctc_02_asme1_ap203.stp"
from urllib.request import urlopen
from tempfile import mkstemp
from os import fdopen, close
tempno, tempname = mkstemp(suffix=".stp")
with fdopen(tempno, mode="wb") as outp:
with urlopen(source_url) as resp:
data = resp.read()
print("read %i bytes from HTTP response body" % len(data))
print(repr(data[:64]))
outp.write(data)
print("url %s copied to %s" % (source_url,tempname))
read 3361627 bytes from HTTP response body b"ISO-10303-21;\r\nHEADER;\r\nFILE_DESCRIPTION(('CTC-02 geometry with " url https://spri-open-resources.s3.us-east-2.amazonaws.com/nist_ctc_02_asme1_ap203.stp copied to /tmp/tmpv4w9o2z2.stp
from OCC.Extend.DataExchange import read_step_file
from OCC.Display.WebGl.x3dom_renderer import X3DExporter
shp = read_step_file(tempname)
print("contents of STEP file read to generate OpenCascade instance: %s" % repr(shp))
** Model Complete Check List **
Check: 1 -- Entity (n0:id) 8662:#8719 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check: 2 -- Entity (n0:id) 8664:#8721 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check: 3 -- Entity (n0:id) 8666:#8723 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check: 4 -- Entity (n0:id) 8668:#8725 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check: 5 -- Entity (n0:id) 8670:#8727 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check: 6 -- Entity (n0:id) 8672:#8729 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check: 7 -- Entity (n0:id) 8674:#8731 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check: 8 -- Entity (n0:id) 8676:#8733 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check: 9 -- Entity (n0:id) 8678:#8735 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:10 -- Entity (n0:id) 8680:#8737 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:11 -- Entity (n0:id) 8682:#8739 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:12 -- Entity (n0:id) 8684:#8741 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:13 -- Entity (n0:id) 8686:#8743 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:14 -- Entity (n0:id) 8688:#8745 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:15 -- Entity (n0:id) 8690:#8747 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:16 -- Entity (n0:id) 8692:#8749 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:17 -- Entity (n0:id) 8694:#8751 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:18 -- Entity (n0:id) 8696:#8753 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:19 -- Entity (n0:id) 8698:#8755 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:20 -- Entity (n0:id) 8700:#8757 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:21 -- Entity (n0:id) 8702:#8759 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:22 -- Entity (n0:id) 8704:#8761 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:23 -- Entity (n0:id) 8706:#8763 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:24 -- Entity (n0:id) 8708:#8765 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:25 -- Entity (n0:id) 8710:#8767 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:26 -- Entity (n0:id) 8712:#8769 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:27 -- Entity (n0:id) 8714:#8771 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:28 -- Entity (n0:id) 8716:#8773 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:29 -- Entity (n0:id) 8718:#8775 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:30 -- Entity (n0:id) 8720:#8777 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:31 -- Entity (n0:id) 8722:#8779 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:32 -- Entity (n0:id) 8724:#8781 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:33 -- Entity (n0:id) 8726:#8783 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:34 -- Entity (n0:id) 8728:#8785 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:35 -- Entity (n0:id) 8730:#8787 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:36 -- Entity (n0:id) 8732:#8789 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:37 -- Entity (n0:id) 8734:#8791 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:38 -- Entity (n0:id) 8736:#8793 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:39 -- Entity (n0:id) 8738:#8795 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:40 -- Entity (n0:id) 8740:#8797 Type:PRESENTATION_STYLE_ASSIGNMENT
Parametecontents of STEP file read to generate OpenCascade instance: <class 'TopoDS_Compound'>
r n0.1 (styles) : Entity has illegal type
Check:41 -- Entity (n0:id) 8742:#8799 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:42 -- Entity (n0:id) 8744:#8801 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:43 -- Entity (n0:id) 8746:#8803 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:44 -- Entity (n0:id) 8748:#8805 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:45 -- Entity (n0:id) 8750:#8807 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
Check:46 -- Entity (n0:id) 8752:#8809 Type:PRESENTATION_STYLE_ASSIGNMENT
Parameter n0.1 (styles) : Entity has illegal type
x3dexp = X3DExporter(shp, None, None, True, (1,1,0), (0,0,0), 0, 0, (0,0,0), 2, 1)
x3dexp.compute()
x3dtriangles=x3dexp.to_x3dfile_string(0)
Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation. Skipped free edge during shape tesselation/edges computation.
x3domHTML = '''<script type='text/javascript' src='https://www.x3dom.org/download/dev/x3dom-full.debug.js'> </script>
<link rel='stylesheet' type='text/css' href='https://www.x3dom.org/download/dev/x3dom.css'></link>'''
import xml.etree.ElementTree as ET
from IPython.display import HTML
x3domX3Dtriangles = ET.tostring(ET.XML(x3dtriangles), encoding="unicode", short_empty_elements=False)
HTML(x3domHTML + x3domX3Dtriangles)