jayesh3/cadmium — Issue #2: stl import
Author: t4rj4n
Created: 2011-10-26 14:07:19+00:00
State: open

Hallo,

i dont know if it is possible to import an stl and use it a primive.
I tried to do it but keep getting a runtime exception in line "
test = sol + s0":

"Message	File Name	Line	Position
Traceback
C:\Documents and Settings\Tarjan\My Documents\Downloads\jayesh3-cadmium-ff4e994\jayesh3-cadmium-ff4e994\examples\example-001b.py	21
__add__	c:\Python26\Lib\site-packages\cadmium\solid.py	42
RuntimeError: StdFail_NotDone
BRep_API: command not done	"

My Code is:

#!/usr/bin/python

import sys
import math
sys.path.append('./src')

from cadmium import *

stlfname = "example.stl"#sys.argv[1]

s0 = Sphere(r=4)

from OCC.Utils.DataExchange import STL
reader = STL.STLImporter(r'basebrick.stl')
reader.read_file()

sol = Solid(reader.get_shape())

test = sol + s0

test.toSTL(stlfname)

---------------------------
If somebody tells me how, ican upload the stl file. It seems that the OpenCASCADE lib throws the exception. But i cant step into it...

Tarjan