pyOCCT icon indicating copy to clipboard operation
pyOCCT copied to clipboard

Is XSDRAWSTLVRML or anything under TKXSDRAW available in pyocct?

Open capfish opened this issue 4 years ago • 3 comments

Context

Hi, I'm trying to follow these guidelines for viewing an STL: https://dev.opencascade.org/doc/overview/html/occt_user_guides__visualization.html#occt_visu_3_5_5

But I am unable to find XSDRAWSTLVRML to create the data source as MeshVS.MeshVS_DataSource doesn't have a constructor. Is this class available somewhere within pyOCCT? I have been unable to find it, but also I'm new to OCCT so maybe I'm just missing something/there's another way to create this data source?

>>> import OCCT
>>> for package in pkgutil.iter_modules(OCCT.__path__):
...     try:
...         foo = foo + dir(importlib.import_module(f'OCCT.{package.name}'))
...     except:
...         print(package.name)
...
IVtkTools
RWGltf
step
>>> [bar for bar in foo if 'xsdraw' in bar.lower()]
[]
>>> [bar for bar in foo if 'stlvrml' in bar.lower()]
[]

It's also not in those modules that it couldn't import.

Your Environment

  • Version used: 7.5.2.1
  • Operating System and version (desktop or mobile): Windows 10, Debian 9 Stretch, Desktop

Thanks!

capfish avatar Oct 25 '21 23:10 capfish

Not able to look at it closely yet, but the DRAW packages are not wrapped in pyOCCT.

Maybe you can read the STL and build the Mesh manually starting from (or around?) https://dev.opencascade.org/doc/refman/html/class_mesh_v_s___mesh_prs_builder.html

trelau avatar Oct 26 '21 01:10 trelau

Ah thank you, I will try to make the Mesh presentation from the MeshVS_PrsBuilder and let you know how it goes.

capfish avatar Oct 26 '21 18:10 capfish

cool. if you have success you're welcome to share code or file here and i'll it to the examples and test database.

trelau avatar Oct 26 '21 21:10 trelau