GithubHelp home page GithubHelp logo

tpaviot / pythonocc-core Goto Github PK

View Code? Open in Web Editor NEW
1.2K 69.0 359.0 86.54 MB

Python package for 3D CAD/BIM/PLM/CAM

License: GNU Lesser General Public License v3.0

Shell 0.01% CMake 0.08% Python 16.18% C++ 1.88% Batchfile 0.01% C 0.33% SWIG 81.48% HTML 0.04%
3d cad python webgl pythonocc oce

pythonocc-core's Introduction

Welcome to Thomas Paviot's GitHub ๐Ÿ‘‹

pythonocc-core's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pythonocc-core's Issues

conda packaging solution has to be extended to support linux and windows

In the conda REAME.md file, conda support is presented as a wip. In order to complete this work, 2 things are necessary:

  • explain, in the documentation, how to use the yaml, build.sh and other files that are made available in the pythonocc-core source repository. Indeed, to install pythonocc-core on its own machine, only the REAME.md file is necessary. The documentation has to explain how to compile and upload new binaries to a shared location. This would allow users to contribute binaries ;
  • so far, this work is osx specific. It has to be ported to linux and windows. Actually, this is on these platforms, and not osx, that distributing binaries is the more difficult.

I tag this issue as 0.16.0. If ever this is not possible to be achieved within this week, I will move the conda code to another branch, merged will be delayed to the 0.17.0 milestone.

OCC.MeshVS is missing

So the MeshVS module deals with the fast display of mesh data.
In order to render STL meshes and anything generated from SMESH in the viewer, these classes need to be available.

On GetHandle(self): TypeError: int() argument must be a string or a number, not 'PyCapsule'

Using py3.4 on windows
TypeError: int() argument must be a string or a number, not 'PyCapsule'
on
def GetHandle(self):
return int(self._winId())

replace by

def GetHandle(self):
ctypes.pythonapi.PyCapsule_GetPointer.restype = ctypes.c_void_p
ctypes.pythonapi.PyCapsule_GetPointer.argtypes = [ctypes.py_object]
return ctypes.pythonapi.PyCapsule_GetPointer(self.winId(), None)

VRML export missing?

On your feature list you say you support VRML export. I can't find a hint on how to export my geometry in VRML.
Please point me to the specific method.

Thanks,
Peter

Problem with boolean operation

Hello,
I'm just working with BSplineSurfaces, solids and boolean operations.
In the following example the BRepAlgoAPI_Cut and BRepAlgoAPI_Common functions don't work.
The BRepAlgoAPI_Fuse function is working.

from OCC.gp import *
from OCC.TColgp import *
from OCC.TColStd import *
from OCC.Geom import *
from OCC.GeomFill import *
from OCC.BRepBuilderAPI import *
from OCC.BRepFill import *
from OCC.GC import *
from OCC.TopoDS import *
from OCC.BRep import *
from OCC.BRepPrimAPI import *
from OCC.BRepAlgoAPI import *

from OCC.Display.SimpleGui import init_display
display, start_display, add_menu, add_function_to_menu = init_display()
display.DisableAntiAliasing()
def bsplineSurface(zVal,xFak_Val,yFak_Val):
nCP_U = 4
nCP_V = 4
degree_U = 3
degree_V = 3
#k_U = degree_U +1
#k_V = degree_V +1
z = zVal
xFak = xFak_Val
yFak = yFak_Val
array_Pol = TColgp_Array2OfPnt(1, nCP_U,1,nCP_V)
array_Pol.SetValue(1,1, gp_Pnt(0_xFak, 0_yFak, 0))
array_Pol.SetValue(1,2, gp_Pnt(0_xFak, 1_yFak, 0))
array_Pol.SetValue(1,3, gp_Pnt(0_xFak, 2_yFak, 0))
array_Pol.SetValue(1,4, gp_Pnt(0_xFak, 3_yFak, 0))
array_Pol.SetValue(2,1, gp_Pnt(1_xFak, 0_yFak, 0))
array_Pol.SetValue(2,2, gp_Pnt(1_xFak, 1_yFak, z))
array_Pol.SetValue(2,3, gp_Pnt(1_xFak, 2_yFak, z))
array_Pol.SetValue(2,4, gp_Pnt(1_xFak, 3_yFak, 0))
array_Pol.SetValue(3,1, gp_Pnt(2_xFak, 0_yFak, 0))
array_Pol.SetValue(3,2, gp_Pnt(2_xFak, 1_yFak, z))
array_Pol.SetValue(3,3, gp_Pnt(2_xFak, 2_yFak, z))
array_Pol.SetValue(3,4, gp_Pnt(2_xFak, 3_yFak, 0))
array_Pol.SetValue(4,1, gp_Pnt(3_xFak, 0_yFak, 0))
array_Pol.SetValue(4,2, gp_Pnt(3_xFak, 1_yFak, 0))
array_Pol.SetValue(4,3, gp_Pnt(3_xFak, 2_yFak, 0))
array_Pol.SetValue(4,4, gp_Pnt(3_xFak, 3_yFak, 0))
array_Knots_U = TColStd_Array1OfReal(1, 2)
array_Knots_U.SetValue(1, 0.0)
array_Knots_U.SetValue(2, 0.1)
array_Multi_U = TColStd_Array1OfInteger(1,2)
array_Multi_U.SetValue(1,4)
array_Multi_U.SetValue(2,4)
array_Knots_V = TColStd_Array1OfReal(1,2)
array_Knots_V.SetValue(1, 0.0)
array_Knots_V.SetValue(2, 0.1)
array_Multi_V = TColStd_Array1OfInteger(1,2)
array_Multi_V.SetValue(1,4)
array_Multi_V.SetValue(2,4)
return Geom_BSplineSurface(array_Pol,array_Knots_U,array_Knots_V,array_Multi_U,array_Multi_V,degree_U,degree_V,False,False)

if name == 'main':
aTol = 1e-06
aSurface =bsplineSurface(2,1,1)
aFace = BRepBuilderAPI_MakeFace(aSurface.GetHandle(),aTol)
aSurface1 = bsplineSurface(-4,1,1)
aFace1 = BRepBuilderAPI_MakeFace(aSurface1.GetHandle(),aTol)
aBuilder = BRep_Builder()
aShell = TopoDS_Shell()
aBuilder.MakeShell(aShell)
aBuilder.Add(aShell,aFace.Shape())
aBuilder.Add(aShell,aFace1.Shape())
aSolid = BRepBuilderAPI_MakeSolid(aShell)
anOrigin = gp_Pnt(1.5,1.5,-5)
aDir = gp_Dir(gp_XYZ(0,0,1))
anAxis = gp_Ax2(anOrigin,aDir)
aRadius = 0.5
aHeight = 10
aCylinder = BRepPrimAPI_MakeCylinder(anAxis,aRadius,aHeight)
aCut = BRepAlgoAPI_Cut(aSolid.Shape(),aCylinder.Shape())
aCommon = BRepAlgoAPI_Common(aSolid.Shape(),aCylinder.Shape())
aFuse = BRepAlgoAPI_Fuse(aSolid.Shape(),aCylinder.Shape())
display.DisplayShape(aCut.Shape())
#display.DisplayShape(aCommon.Shape())
#display.DisplayShape(aFuse.Shape())
display.FitAll()
start_display()

Some ideas?
Best Regards
Achim

SetPixelFormat failed. Error code: 2000

Hi,

I get the following stacktrace when initializing SimpleGui, using the 0.16 release on Windows.

File "C:\Program Files (x86)\Python2.7.9\lib\site-packages\OCC\Display\SimpleGui.py", line 164, in init_display
    win.canva.InitDriver()
  File "C:\Program Files (x86)\Python2.7.9\lib\site-packages\OCC\Display\pyqt4Display.py", line 80, in InitDriver
    self._display.Create()
  File "C:\Program Files (x86)\Python2.7.9\lib\site-packages\OCC\Display\OCCViewer.py", line 105, in Create
    self.Init(self._window_handle)
RuntimeError: Aspect_GraphicDeviceDefinitionError
OpenGl_Window::CreateWindow: SetPixelFormat failed. Error code: 2000

I looked around and saw you referenced the same error, some time ago:
https://mail.gna.org/public/pythonocc-users/2013-04/msg00010.html
(coincidently I am also on an acer notebook)

Is this something that is still on the radar? I saw a stackoverflow post with similar problems and nasty solutions:
http://stackoverflow.com/questions/199016/wglcreatecontext-in-c-sharp-failing-but-not-in-managed-c#answer-206933

Looking forward to your insights,

Thanks,
Thomas

PyPI package points to wrong url

Sorry, this is probably not the place to post this report, but I could not figure out where to do it.

I noticed that there is a package "pythonOCC" on pypi which points to source code on Google. I suppose this is from some time ago when you perhaps used google to host your code instead of github. May I request that you either update the package or remove it from pypi? It is a bit confusing to find it with "pip search", but then not being able to install it.

Compilation Fails Without Giving a Reason

Ubuntu 14.04, OCE 0.16, latest PythonOCC from the git repo (also tried with 0.16-pre-1 tagged version.

When I compile I see that an error occurred and I'm pointed to the cmake log file, but it doesn't seem to show any errors (that I notice). Below are the contents of the CMakeOutput.log file.

The system is: Linux - 3.13.0-32-generic - i686
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler: /usr/bin/gcc 
Build flags: 
Id flags: 

The output was:
0


Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out"

The C compiler identification is GNU, found in "/home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/2.8.12.2/CompilerIdC/a.out"

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: /usr/bin/g++ 
Build flags: 
Id flags: 

The output was:
0


Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out"

The CXX compiler identification is GNU, found in "/home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/2.8.12.2/CompilerIdCXX/a.out"

Determining if the C compiler works passed with the following output:
Change Dir: /home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec3589411924/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec3589411924.dir/build.make CMakeFiles/cmTryCompileExec3589411924.dir/build
make[1]: Entering directory `/home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec3589411924.dir/testCCompiler.c.o
/usr/bin/gcc    -o CMakeFiles/cmTryCompileExec3589411924.dir/testCCompiler.c.o   -c /home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTryCompileExec3589411924
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec3589411924.dir/link.txt --verbose=1
/usr/bin/gcc       CMakeFiles/cmTryCompileExec3589411924.dir/testCCompiler.c.o  -o cmTryCompileExec3589411924 -rdynamic 
make[1]: Leaving directory `/home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/CMakeTmp'


Detecting C compiler ABI info compiled with the following output:
Change Dir: /home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec1665213931/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec1665213931.dir/build.make CMakeFiles/cmTryCompileExec1665213931.dir/build
make[1]: Entering directory `/home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec1665213931.dir/CMakeCCompilerABI.c.o
/usr/bin/gcc    -o CMakeFiles/cmTryCompileExec1665213931.dir/CMakeCCompilerABI.c.o   -c /usr/share/cmake-2.8/Modules/CMakeCCompilerABI.c
Linking C executable cmTryCompileExec1665213931
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1665213931.dir/link.txt --verbose=1
/usr/bin/gcc     -v CMakeFiles/cmTryCompileExec1665213931.dir/CMakeCCompilerABI.c.o  -o cmTryCompileExec1665213931 -rdynamic  
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.8/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-i386 --with-arch-directory=i386 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-targets=all --enable-multiarch --disable-werror --with-arch-32=i686 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) 
COMPILER_PATH=/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.8/../../../../lib/:/lib/i386-linux-gnu/:/lib/../lib/:/usr/lib/i386-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/i686-linux-gnu/4.8/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTryCompileExec1665213931' '-rdynamic' '-mtune=generic' '-march=i686'
 /usr/lib/gcc/i686-linux-gnu/4.8/collect2 --sysroot=/ --build-id --eh-frame-hdr -m elf_i386 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib/ld-linux.so.2 -z relro -o cmTryCompileExec1665213931 /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crti.o /usr/lib/gcc/i686-linux-gnu/4.8/crtbegin.o -L/usr/lib/gcc/i686-linux-gnu/4.8 -L/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu -L/usr/lib/gcc/i686-linux-gnu/4.8/../../../../lib -L/lib/i386-linux-gnu -L/lib/../lib -L/usr/lib/i386-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/i686-linux-gnu/4.8/../../.. CMakeFiles/cmTryCompileExec1665213931.dir/CMakeCCompilerABI.c.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/i686-linux-gnu/4.8/crtend.o /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crtn.o
make[1]: Leaving directory `/home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/CMakeTmp'


Parsed C implicit link information from above output:
  link line regex: [^( *|.*[/\])(ld|([^/\]+-)?ld|collect2)[^/\]*( |$)]
  ignore line: [Change Dir: /home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/CMakeTmp]
  ignore line: []
  ignore line: [Run Build Command:/usr/bin/make "cmTryCompileExec1665213931/fast"]
  ignore line: [/usr/bin/make -f CMakeFiles/cmTryCompileExec1665213931.dir/build.make CMakeFiles/cmTryCompileExec1665213931.dir/build]
  ignore line: [make[1]: Entering directory `/home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/CMakeTmp']
  ignore line: [/usr/bin/cmake -E cmake_progress_report /home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/CMakeTmp/CMakeFiles 1]
  ignore line: [Building C object CMakeFiles/cmTryCompileExec1665213931.dir/CMakeCCompilerABI.c.o]
  ignore line: [/usr/bin/gcc    -o CMakeFiles/cmTryCompileExec1665213931.dir/CMakeCCompilerABI.c.o   -c /usr/share/cmake-2.8/Modules/CMakeCCompilerABI.c]
  ignore line: [Linking C executable cmTryCompileExec1665213931]
  ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1665213931.dir/link.txt --verbose=1]
  ignore line: [/usr/bin/gcc     -v CMakeFiles/cmTryCompileExec1665213931.dir/CMakeCCompilerABI.c.o  -o cmTryCompileExec1665213931 -rdynamic  ]
  ignore line: [Using built-in specs.]
  ignore line: [COLLECT_GCC=/usr/bin/gcc]
  ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.8/lto-wrapper]
  ignore line: [Target: i686-linux-gnu]
  ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-i386 --with-arch-directory=i386 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-targets=all --enable-multiarch --disable-werror --with-arch-32=i686 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu]
  ignore line: [Thread model: posix]
  ignore line: [gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ]
  ignore line: [COMPILER_PATH=/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/]
  ignore line: [LIBRARY_PATH=/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.8/../../../../lib/:/lib/i386-linux-gnu/:/lib/../lib/:/usr/lib/i386-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/i686-linux-gnu/4.8/../../../:/lib/:/usr/lib/]
  ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTryCompileExec1665213931' '-rdynamic' '-mtune=generic' '-march=i686']
  link line: [ /usr/lib/gcc/i686-linux-gnu/4.8/collect2 --sysroot=/ --build-id --eh-frame-hdr -m elf_i386 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib/ld-linux.so.2 -z relro -o cmTryCompileExec1665213931 /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crti.o /usr/lib/gcc/i686-linux-gnu/4.8/crtbegin.o -L/usr/lib/gcc/i686-linux-gnu/4.8 -L/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu -L/usr/lib/gcc/i686-linux-gnu/4.8/../../../../lib -L/lib/i386-linux-gnu -L/lib/../lib -L/usr/lib/i386-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/i686-linux-gnu/4.8/../../.. CMakeFiles/cmTryCompileExec1665213931.dir/CMakeCCompilerABI.c.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/i686-linux-gnu/4.8/crtend.o /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crtn.o]
    arg [/usr/lib/gcc/i686-linux-gnu/4.8/collect2] ==> ignore
    arg [--sysroot=/] ==> ignore
    arg [--build-id] ==> ignore
    arg [--eh-frame-hdr] ==> ignore
    arg [-m] ==> ignore
    arg [elf_i386] ==> ignore
    arg [--hash-style=gnu] ==> ignore
    arg [--as-needed] ==> ignore
    arg [-export-dynamic] ==> ignore
    arg [-dynamic-linker] ==> ignore
    arg [/lib/ld-linux.so.2] ==> ignore
    arg [-zrelro] ==> ignore
    arg [-o] ==> ignore
    arg [cmTryCompileExec1665213931] ==> ignore
    arg [/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o] ==> ignore
    arg [/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crti.o] ==> ignore
    arg [/usr/lib/gcc/i686-linux-gnu/4.8/crtbegin.o] ==> ignore
    arg [-L/usr/lib/gcc/i686-linux-gnu/4.8] ==> dir [/usr/lib/gcc/i686-linux-gnu/4.8]
    arg [-L/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu] ==> dir [/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu]
    arg [-L/usr/lib/gcc/i686-linux-gnu/4.8/../../../../lib] ==> dir [/usr/lib/gcc/i686-linux-gnu/4.8/../../../../lib]
    arg [-L/lib/i386-linux-gnu] ==> dir [/lib/i386-linux-gnu]
    arg [-L/lib/../lib] ==> dir [/lib/../lib]
    arg [-L/usr/lib/i386-linux-gnu] ==> dir [/usr/lib/i386-linux-gnu]
    arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib]
    arg [-L/usr/lib/gcc/i686-linux-gnu/4.8/../../..] ==> dir [/usr/lib/gcc/i686-linux-gnu/4.8/../../..]
    arg [CMakeFiles/cmTryCompileExec1665213931.dir/CMakeCCompilerABI.c.o] ==> ignore
    arg [-lgcc] ==> lib [gcc]
    arg [--as-needed] ==> ignore
    arg [-lgcc_s] ==> lib [gcc_s]
    arg [--no-as-needed] ==> ignore
    arg [-lc] ==> lib [c]
    arg [-lgcc] ==> lib [gcc]
    arg [--as-needed] ==> ignore
    arg [-lgcc_s] ==> lib [gcc_s]
    arg [--no-as-needed] ==> ignore
    arg [/usr/lib/gcc/i686-linux-gnu/4.8/crtend.o] ==> ignore
    arg [/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crtn.o] ==> ignore
  remove lib [gcc]
  remove lib [gcc_s]
  remove lib [gcc]
  remove lib [gcc_s]
  collapse library dir [/usr/lib/gcc/i686-linux-gnu/4.8] ==> [/usr/lib/gcc/i686-linux-gnu/4.8]
  collapse library dir [/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu] ==> [/usr/lib/i386-linux-gnu]
  collapse library dir [/usr/lib/gcc/i686-linux-gnu/4.8/../../../../lib] ==> [/usr/lib]
  collapse library dir [/lib/i386-linux-gnu] ==> [/lib/i386-linux-gnu]
  collapse library dir [/lib/../lib] ==> [/lib]
  collapse library dir [/usr/lib/i386-linux-gnu] ==> [/usr/lib/i386-linux-gnu]
  collapse library dir [/usr/lib/../lib] ==> [/usr/lib]
  collapse library dir [/usr/lib/gcc/i686-linux-gnu/4.8/../../..] ==> [/usr/lib]
  implicit libs: [c]
  implicit dirs: [/usr/lib/gcc/i686-linux-gnu/4.8;/usr/lib/i386-linux-gnu;/usr/lib;/lib/i386-linux-gnu;/lib]
  implicit fwks: []


Determining if the CXX compiler works passed with the following output:
Change Dir: /home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec1385369238/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec1385369238.dir/build.make CMakeFiles/cmTryCompileExec1385369238.dir/build
make[1]: Entering directory `/home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec1385369238.dir/testCXXCompiler.cxx.o
/usr/bin/g++     -o CMakeFiles/cmTryCompileExec1385369238.dir/testCXXCompiler.cxx.o -c /home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTryCompileExec1385369238
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1385369238.dir/link.txt --verbose=1
/usr/bin/g++        CMakeFiles/cmTryCompileExec1385369238.dir/testCXXCompiler.cxx.o  -o cmTryCompileExec1385369238 -rdynamic 
make[1]: Leaving directory `/home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/CMakeTmp'


Detecting CXX compiler ABI info compiled with the following output:
Change Dir: /home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec2080007913/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec2080007913.dir/build.make CMakeFiles/cmTryCompileExec2080007913.dir/build
make[1]: Entering directory `/home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec2080007913.dir/CMakeCXXCompilerABI.cpp.o
/usr/bin/g++     -o CMakeFiles/cmTryCompileExec2080007913.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-2.8/Modules/CMakeCXXCompilerABI.cpp
Linking CXX executable cmTryCompileExec2080007913
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec2080007913.dir/link.txt --verbose=1
/usr/bin/g++      -v CMakeFiles/cmTryCompileExec2080007913.dir/CMakeCXXCompilerABI.cpp.o  -o cmTryCompileExec2080007913 -rdynamic  
Using built-in specs.
COLLECT_GCC=/usr/bin/g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.8/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-i386 --with-arch-directory=i386 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-targets=all --enable-multiarch --disable-werror --with-arch-32=i686 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) 
COMPILER_PATH=/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.8/../../../../lib/:/lib/i386-linux-gnu/:/lib/../lib/:/usr/lib/i386-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/i686-linux-gnu/4.8/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTryCompileExec2080007913' '-rdynamic' '-shared-libgcc' '-mtune=generic' '-march=i686'
 /usr/lib/gcc/i686-linux-gnu/4.8/collect2 --sysroot=/ --build-id --eh-frame-hdr -m elf_i386 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib/ld-linux.so.2 -z relro -o cmTryCompileExec2080007913 /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crti.o /usr/lib/gcc/i686-linux-gnu/4.8/crtbegin.o -L/usr/lib/gcc/i686-linux-gnu/4.8 -L/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu -L/usr/lib/gcc/i686-linux-gnu/4.8/../../../../lib -L/lib/i386-linux-gnu -L/lib/../lib -L/usr/lib/i386-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/i686-linux-gnu/4.8/../../.. CMakeFiles/cmTryCompileExec2080007913.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/i686-linux-gnu/4.8/crtend.o /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crtn.o
make[1]: Leaving directory `/home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/CMakeTmp'


Parsed CXX implicit link information from above output:
  link line regex: [^( *|.*[/\])(ld|([^/\]+-)?ld|collect2)[^/\]*( |$)]
  ignore line: [Change Dir: /home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/CMakeTmp]
  ignore line: []
  ignore line: [Run Build Command:/usr/bin/make "cmTryCompileExec2080007913/fast"]
  ignore line: [/usr/bin/make -f CMakeFiles/cmTryCompileExec2080007913.dir/build.make CMakeFiles/cmTryCompileExec2080007913.dir/build]
  ignore line: [make[1]: Entering directory `/home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/CMakeTmp']
  ignore line: [/usr/bin/cmake -E cmake_progress_report /home/user/Downloads/pythonocc_oce_setup/pythonocc-core/cmake-build/CMakeFiles/CMakeTmp/CMakeFiles 1]
  ignore line: [Building CXX object CMakeFiles/cmTryCompileExec2080007913.dir/CMakeCXXCompilerABI.cpp.o]
  ignore line: [/usr/bin/g++     -o CMakeFiles/cmTryCompileExec2080007913.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-2.8/Modules/CMakeCXXCompilerABI.cpp]
  ignore line: [Linking CXX executable cmTryCompileExec2080007913]
  ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec2080007913.dir/link.txt --verbose=1]
  ignore line: [/usr/bin/g++      -v CMakeFiles/cmTryCompileExec2080007913.dir/CMakeCXXCompilerABI.cpp.o  -o cmTryCompileExec2080007913 -rdynamic  ]
  ignore line: [Using built-in specs.]
  ignore line: [COLLECT_GCC=/usr/bin/g++]
  ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.8/lto-wrapper]
  ignore line: [Target: i686-linux-gnu]
  ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-i386 --with-arch-directory=i386 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-targets=all --enable-multiarch --disable-werror --with-arch-32=i686 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu]
  ignore line: [Thread model: posix]
  ignore line: [gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ]
  ignore line: [COMPILER_PATH=/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/]
  ignore line: [LIBRARY_PATH=/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.8/../../../../lib/:/lib/i386-linux-gnu/:/lib/../lib/:/usr/lib/i386-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/i686-linux-gnu/4.8/../../../:/lib/:/usr/lib/]
  ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTryCompileExec2080007913' '-rdynamic' '-shared-libgcc' '-mtune=generic' '-march=i686']
  link line: [ /usr/lib/gcc/i686-linux-gnu/4.8/collect2 --sysroot=/ --build-id --eh-frame-hdr -m elf_i386 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib/ld-linux.so.2 -z relro -o cmTryCompileExec2080007913 /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crti.o /usr/lib/gcc/i686-linux-gnu/4.8/crtbegin.o -L/usr/lib/gcc/i686-linux-gnu/4.8 -L/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu -L/usr/lib/gcc/i686-linux-gnu/4.8/../../../../lib -L/lib/i386-linux-gnu -L/lib/../lib -L/usr/lib/i386-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/i686-linux-gnu/4.8/../../.. CMakeFiles/cmTryCompileExec2080007913.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/i686-linux-gnu/4.8/crtend.o /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crtn.o]
    arg [/usr/lib/gcc/i686-linux-gnu/4.8/collect2] ==> ignore
    arg [--sysroot=/] ==> ignore
    arg [--build-id] ==> ignore
    arg [--eh-frame-hdr] ==> ignore
    arg [-m] ==> ignore
    arg [elf_i386] ==> ignore
    arg [--hash-style=gnu] ==> ignore
    arg [--as-needed] ==> ignore
    arg [-export-dynamic] ==> ignore
    arg [-dynamic-linker] ==> ignore
    arg [/lib/ld-linux.so.2] ==> ignore
    arg [-zrelro] ==> ignore
    arg [-o] ==> ignore
    arg [cmTryCompileExec2080007913] ==> ignore
    arg [/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o] ==> ignore
    arg [/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crti.o] ==> ignore
    arg [/usr/lib/gcc/i686-linux-gnu/4.8/crtbegin.o] ==> ignore
    arg [-L/usr/lib/gcc/i686-linux-gnu/4.8] ==> dir [/usr/lib/gcc/i686-linux-gnu/4.8]
    arg [-L/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu] ==> dir [/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu]
    arg [-L/usr/lib/gcc/i686-linux-gnu/4.8/../../../../lib] ==> dir [/usr/lib/gcc/i686-linux-gnu/4.8/../../../../lib]
    arg [-L/lib/i386-linux-gnu] ==> dir [/lib/i386-linux-gnu]
    arg [-L/lib/../lib] ==> dir [/lib/../lib]
    arg [-L/usr/lib/i386-linux-gnu] ==> dir [/usr/lib/i386-linux-gnu]
    arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib]
    arg [-L/usr/lib/gcc/i686-linux-gnu/4.8/../../..] ==> dir [/usr/lib/gcc/i686-linux-gnu/4.8/../../..]
    arg [CMakeFiles/cmTryCompileExec2080007913.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore
    arg [-lstdc++] ==> lib [stdc++]
    arg [-lm] ==> lib [m]
    arg [-lgcc_s] ==> lib [gcc_s]
    arg [-lgcc] ==> lib [gcc]
    arg [-lc] ==> lib [c]
    arg [-lgcc_s] ==> lib [gcc_s]
    arg [-lgcc] ==> lib [gcc]
    arg [/usr/lib/gcc/i686-linux-gnu/4.8/crtend.o] ==> ignore
    arg [/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crtn.o] ==> ignore
  remove lib [gcc_s]
  remove lib [gcc]
  remove lib [gcc_s]
  remove lib [gcc]
  collapse library dir [/usr/lib/gcc/i686-linux-gnu/4.8] ==> [/usr/lib/gcc/i686-linux-gnu/4.8]
  collapse library dir [/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu] ==> [/usr/lib/i386-linux-gnu]
  collapse library dir [/usr/lib/gcc/i686-linux-gnu/4.8/../../../../lib] ==> [/usr/lib]
  collapse library dir [/lib/i386-linux-gnu] ==> [/lib/i386-linux-gnu]
  collapse library dir [/lib/../lib] ==> [/lib]
  collapse library dir [/usr/lib/i386-linux-gnu] ==> [/usr/lib/i386-linux-gnu]
  collapse library dir [/usr/lib/../lib] ==> [/usr/lib]
  collapse library dir [/usr/lib/gcc/i686-linux-gnu/4.8/../../..] ==> [/usr/lib]
  implicit libs: [stdc++;m;c]
  implicit dirs: [/usr/lib/gcc/i686-linux-gnu/4.8;/usr/lib/i386-linux-gnu;/usr/lib;/lib/i386-linux-gnu;/lib]
  implicit fwks: []

catching system signals

In order to catch system signals some boiler code ( calls to OSD.SetSignals ) are required.
the question is whether PythonOCC should setup these signals in order to improve / complete error catching.

In order for the application to be able to catch system signals (access violation, division by zero, etc.) in the same way as other exceptions, the appropriate signal handler shall be installed in the runtime by the method OSD::SetSignal().

see discussion on the OCC Forum

Normally this method is called in the beginning of the main() function. It installs a handler that will convert system signals into OCCT exceptions.

In order to actually convert signals to exceptions, macro OCC_CATCH_SIGNALS needs to be inserted in the source code. The typical place where this macro is put is beginning of the try{} block which catches such exceptions.
See for details "Open CASCADE Technology / Users Guides/ Foundation classes /Handling an Exception" chapter.
I do hope it will help you.
Best regards
FSR

STEP file reading issue in Python.

I am using Python3.4.2 and pythonOCC-0.16.0-win32-py34.exe to draw components. Every components are rendered properly with one defined color but that is not look like a real world component.

pythoncomponent

Above image is my Python implementation which generate 3D image from STEP file with one color.

Below image is rendered one of my windows software and there I have used Step file. I want to render component same as look like in below image so its look like a real world component.

comonentwithexactcolor

Is there any way to get correct colored output in Python by read STEP file? I have searched a lot but didn't get a way to implement it. Please help me to go in forward direction.

from future import print_function
import sys

from OCC.STEPCAFControl import STEPCAFControl_Reader

from OCC.STEPControl import STEPControl_Reader
from OCC.IFSelect import IFSelect_RetDone, IFSelect_ItemsByEntity
from OCC.Display.SimpleGui import init_display
from OCC.Display.WebGl import threejs_renderer

step_reader = STEPControl_Reader()
status = step_reader.ReadFile('./models/test.STEP')

if status == IFSelect_RetDone: # check status
failsonly = False
step_reader.PrintCheckLoad(failsonly, IFSelect_ItemsByEntity)
step_reader.PrintCheckTransfer(failsonly, IFSelect_ItemsByEntity)

ok = step_reader.TransferRoot(1)
_nbs = step_reader.NbShapes()
aResShape = step_reader.Shape(1)

else:
print("Error: can't read file.")
sys.exit(0)

display, start_display, add_menu, add_function_to_menu = init_display()

display.DisplayShape(aResShape, update=True)

start_display()

my_renderer = threejs_renderer.ThreejsRenderer(background_color="#123345")
my_renderer.DisplayShape(aResShape)

The above code is used for read STEP file using Python.

Embedding PythonOCC as a Library in an Application

Just wondering if there are any resources on how to embed PythonOCC (and OCE) properly within another application. I've already got PythonOCC with OCE up and running on Ubuntu 14.04 64-bit. I'm working on a sample PySide based app, and would like to package everything up so that all another Ubuntu 14.04 64-bit user would have to do is clone the PySide app from GitHub (better support for installing and more platforms would come later).

A quick search on Google didn't turn up what I'm looking for.

After building PythonOCC, I have the following directory.

..../cmake-build/Unix/x86_64-MinSizeRel-64/

The .py files from this build directory ended up in...

/usr/lib/python2.7/dist-packages/OCC/

Which leads me to think that I can copy the OCC directory to my project's directory tree and then manipulate sys.path. I've embedded libraries in a similar way before, but this will be my first in-depth work with PythonOCC or OCE.

Missing some Python OCC module .

Downloaded pythonOCC-0.16.0-win32-py34.exe and installed. After installation found some module is missing (for example - OCC.STEPCAFControl, OCC.TDocStd). How to get this module?

Please help.

TopoDS_Shape subclasses cannot be inherited from

The following is a pretty serious regression...
AFAIK its not possible to inherit any TopoDS_Shape decendents

This is because the TopoDS_Edge ( and TopoDS_Face and friends )
do not define a ( copy? ) constructor that takes a existing ( TopoDS_Edge here ) instance as argument

I dont see how this can be by-passed using OCC.TopoDS.topods.Edge or OCC.TopoDS.topods_Edge

That means that we can't inherit from TopoDS_Shape subclasses...

from OCC.BRepBuilderAPI import BRepBuilderAPI_MakeEdge
from OCC.TopoDS import topods_Edge, TopoDS_Edge
from OCC.gp import gp_Pnt


line = BRepBuilderAPI_MakeEdge(gp_Pnt(), gp_Pnt(100,0,0)).Edge()

class InheritEdge(topods_Edge):
    def __init__(self, edge):
        super(InheritEdge, self).__init__(edge)

"""

cannot inherit from:

Traceback (most recent call last):
  File "/Users/jelleferinga/GIT/pythonocc-core/src/addons/Utils/tst.py", line 8, in <module>
    class InheritEdge(topods_Edge):
TypeError: Error when calling the metaclass bases
    function() argument 1 must be code, not str
"""

class InheritEdge(TopoDS_Edge):
    def __init__(self, edge):
        # no constructor defined... 
        # TopoDS_Edge() just returns an uninitialized TopoDS_Edge...
        super(InheritEdge, self).__init__(edge)

from OCC.StlAPI module missing

IMHO the reader API is terrible ( converting a mesh -> brep is not trivial at all... this is just converting the triangle as a BRep surface... a horrible conceptual confusion... ). If included, I think it would be well to inform users that this does not magically reconstruct a CAD model from a mesh ( I've seen this question often come about at the OCC forum and for a mesh of a non-trivial size, it'll take forever / lost of memory and basically, not do what you'd like )

But being able to export meshed BRep's to an STL file is a piece of core functionality if you ask me.

MS_WIN64 need to be add to C(XX)_FLAGS for mingw64

Hi,

I managed to compile pythonocc for python2, but I had to add MS_WIN64 to the C_FLAGS and CXX_FLAGS :

-DCMAKE_C_FLAGS_RELEASE="-O3 -DNDEBUG -DMS_WIN64" \
-DCMAKE_C_FLAGS_MINSIZEREL="-Os -DNDEBUG -DMS_WIN64" \
-DCMAKE_C_FLAGS_DEBUG="-g -DMS_WIN64" \
-DCMAKE_C_FLAGS_RELWITHDEBINFO="-O2 -g -DNDEBUG -DMS_WIN64" \
-DCMAKE_CXX_FLAGS_RELEASE="-O3 -DNDEBUG -DMS_WIN64" \
-DCMAKE_CXX_FLAGS_MINSIZEREL="-Os -DNDEBUG -DMS_WIN64" \
-DCMAKE_CXX_FLAGS_DEBUG="-g -DMS_WIN64" \
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-O2 -g -DNDEBUG -DMS_WIN64" \

Not an issue, more a tip, I guess.

gr.
S

BRep_Builder constructor

Hi,

Not sure if this is a bug or my incorrect usage but the following snippet:

from OCC.TopoDS import TopoDS_Compound
from OCC.BRep import BRep_Builder
c = TopoDS_Compound()
bb = BRep_Builder()

was giving the following exception:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-1-215db27b1dce> in <module>()
      4 from OCC.BRep import BRep_Builder
      5 
----> 6 bb = BRep_Builder()
      7 bb.MakeCompound(c)
      8 bb.Add()

/usr/local/lib/python2.7/site-packages/OCC/BRep.py in __init__(self, *args, **kwargs)
    126 class BRep_Builder(OCC.TopoDS.TopoDS_Builder):
    127     thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
--> 128     def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
    129     __repr__ = _swig_repr
    130     def MakeFace(self, *args):

AttributeError: No constructor defined

I "fixed" it by removing the line:

%nodefaultctor BRep_Builder;

from BRep.i but I'm not sure if this is the correct thing to do.

Thanks,
Fergus

Python 3 import problems

The import system for modules is subtly different in python 3 for instance running

python core_helloworld.py will result in:
File "core_helloworld.py", line 21, in <module> display, start_display, add_menu, add_function_to_menu = init_display() File "/usr/lib/python3.4/site-packages/OCC/Display/SimpleGui.py", line 112, in init_display from pyqt4Display import qtViewer3d

This is a module vs file issue and can be easily solved by making the package path explicit

Changing pyqt4Display to OCC.Display.pyqt4Display or by adding an import to the __init__.py file, something like from Display import *. I haven't made a pull request as I don't know which fits better with the style you intend for pythonocc.

Visual3d_Layer misses the .DrawText method

So, the Visual3d_Layer is basically working fine in pyocc 0.16, its just that the .DrawText method is missing...

#!/usr/bin/env python

from OCC.Visual3d import *
from OCC.Quantity import *
from OCC.Aspect import *
from OCC.Graphic3d import *

from OCC.Display.SimpleGui import *
display, start_display, add_menu, add_function_to_menu = init_display()

import time

def set_background_color(event=None):
    clr = display.View.BackgroundColor()
    display.View.SetBackgroundColor(Quantity_NOC_ALICEBLUE)
    print 'Background color set to ALICEBLUE'
    display.Repaint()
    time.sleep(1)
    display.View.SetBackgroundColor(Quantity_NOC_BLACK)
    print 'Background color set to BLACK'
    display.Repaint()
    time.sleep(1)
    display.View.SetBackgroundColor(Quantity_NOC_CYAN1)
    print 'Background color set to CYAN1'
    display.Repaint()
    time.sleep(1)
    display.View.SetBackgroundColor(clr)

def set_background_image(event=None):
    image = 'water_stained_brickwork.bmp'
    display.SetBackgroundImage(image)

def set_layer(event=None):
    view_mgr = display.View.View().GetObject().ViewManager()
    layer = Visual3d_Layer(view_mgr, Aspect_TOL_UNDERLAY, False)
    #a,b,c,d = layer.GetScreenRect()
    h,w = display.View.Window().GetObject().Size()
    print h,w
    #layer.SetViewport(h,w)
    #layer.SetViewport(10,10)
    layer.Clear()
    layer.Begin()
    layer.SetViewport(640,480)

    print "ok"
    # layer.SetTextAttributes( Graphic3d_NOF_ASCII_ITALIC_COMPLEX, Aspect_TODT_NORMAL, Quantity_Color(Quantity_NOC_ORANGE ))
    print "ok2"

<<< missing method
    layer.DrawText('PythonOCC R*cks!!!',0,0,5)
>>>

    print "ok3"
    layer.BeginPolygon()
    layer.SetColor (Quantity_Color(Quantity_NOC_BLACK))
    layer.AddVertex (-1,1)
    layer.AddVertex (1,1)

    layer.SetColor (Quantity_Color(Quantity_NOC_WHITE))
    layer.AddVertex (1,-1)
    layer.AddVertex (-1,-1)
    layer.ClosePrimitive()
    layer.End()
    display.Test()
    display.Repaint()



if __name__ == '__main__':
    add_menu('background')
    add_function_to_menu('background', set_background_image )
    add_function_to_menu('background', set_background_color )
    add_function_to_menu('background', set_layer )
    start_display()

msys2/mingw32 compile of pythonocc fails

Hi,

I finally have a win32 build of oce trunk and I am trying to build pythonocc with it, but this happens:

[.. snip many many undifined reference errors ...]
CMakeFiles/_AIS.dir/objects.a(AISPYTHON_wrap.cxx.obj):AISPYTHON_wrap.cxx:(.text+0xd3e1d): undefined reference to `_imp__PyErr_SetString'
C:/msys64/mingw32/lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles/_AIS.dir/objects.a(AISPYTHON_wrap.cxx.obj): bad reloc address 0xc in section `.data'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [win32/bin/MinSizeRel/_AIS.pyd] Fout 1
make[1]: *** [CMakeFiles/_AIS.dir/all] Fout 2
make: *** [all] Fout 2

I'd like to try building pythonocc with oce-0.16, but building oce-0.16 fails at tkbool..

x3d export

There is support for x3dom rendering but not for exporting x3d files?

Tesselator

from OCC.Visualization import Tesselator
from OCC.BRepPrimAPI import BRepPrimAPI_MakeBox
shape = BRepPrimAPI_MakeBox(1,1,1).Shape()
tes = Tesselator(shape)
tes.VerticesList()

returns :"Swig Object of type 'float *' at 0x2613ae0"

is there a way to get these values in python?

Catching an exception produces memory corruption and core dump

This is against:
OCE-0.16 (https://github.com/tpaviot/oce/tree/OCE-0.16)
pythonocc-core 0.16.0 (https://github.com/tpaviot/pythonocc-core/tree/0.16.0)
on xubuntu 14.04

I noticed that Geom2dAPI_InterCurveCurve::Segment(...) is wrapped such that the user has to pass in new handles.

When the exception is triggered in ::Segment(...) the curves assigned to them are probably released in C++ and I suspect python is also deallocating them during garbage collection.

The fact that there is an exception in ::Segment(...) is probably an OCE bug

That's my guess anyway.

This appears to prevent the use of the Segment method because it could blow your program up at any moment!

Any help is much appreciated.

Here's the example code:

# Ambrus Csaszar 02/25/2015

from OCC import Geom2d
from OCC import Geom2dAPI
from OCC import gp


def build_line2d(origin, direction, t1, t2):
    gp_origin = gp.gp_Pnt2d(gp.gp_XY(*origin))
    gp_direction = gp.gp_Dir2d(gp.gp_XY(*direction))
    curve2d = Geom2d.Geom2d_Line(gp_origin, gp_direction)
    return Geom2d.Geom2d_TrimmedCurve(Geom2d.Handle_Geom2d_Curve(curve2d), t1, t2)


def isect2d(pcurve1, pcurve2, tol):
    # Create handles
    hpcurve1 = Geom2d.Handle_Geom2d_Curve(pcurve1)
    hpcurve2 = Geom2d.Handle_Geom2d_Curve(pcurve2)
    # Create a 2-curve intersector
    sector = Geom2dAPI.Geom2dAPI_InterCurveCurve(hpcurve1, hpcurve2, tol)
    # Count intersections
    segment_count = sector.NbSegments()
    segments = []

    # Extract segment intersections
    for i in xrange(segment_count):

        # We probably shouldn't allocate these in python
        result1 = Geom2d.Handle_Geom2d_Curve()
        result2 = Geom2d.Handle_Geom2d_Curve()

        # This could probably just return:
        #   * a single handle if this is a curve-self intersector
        #   * a tuple of two handles if this is a curve-curve intersector
        sector.Segment(i + 1, result1, result2)

        result1 = None if result1.IsNull() else result1.GetObject()
        result2 = None if result2.IsNull() else result2.GetObject()

        segments.append((result1, result2))

    return segments


if __name__ == "__main__":

    params1 = {
        'origin': [2.922649714250443, -2.5120000000000005],
        'direction': [-0.49999999326941136, -0.8660254076703459],
        't1': 0.0,
        't2': 0.10392304798782465,
    }
    params2 = {
        'origin': [2.7949999993942467, -2.7330957956708906],
        'direction': [0.4999999932694151, 0.8660254076703436],
        't1': 0.0,
        't2': 0.1513763851611979,
    }

    pcurve1 = build_line2d(**params1)
    pcurve2 = build_line2d(**params2)

    tol = 1e-10

    for x in xrange(2):

        # Catching the standard construction error here results in a
        # double-free + core dump
        try:
            isect2d(pcurve1, pcurve2, tol)
        except Exception as ex:
            print ex.message

Output:

root@72793dc45390:/scripts# python testfail.py 
Standard_ConstructionError
Geom2d_TrimmedCurve::U1 == U2
Segmentation fault (core dumped)
root@72793dc45390:/scripts# 

TopoDS_Shape from a pointer?

Would it be possible for pythonocc to get a TopoDS_Shape from a pointer?
This would encourage experimentation from other OCE related projects.

I do realize this would open the gate for segfault hell probably ๐Ÿ™‰

travis build failing | taking too long?

looks like gcc compilation is perhaps taking too long for travis to complete the build?
our GH page says "build failing" which is not the best of advertisements...

is simple only running the clang build an option / quick fix @tpaviot ?

target _TColGeom
[ 86%] Built target _TCollection

>>> g++: internal compiler error: Killed (program cc1plus)

Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
make[2]: *** [CMakeFiles/_TColStd.dir/src/SWIG_files/wrapper/TColStdPYTHON_wrap.cxx.o] Error 4
make[1]: *** [CMakeFiles/_TColStd.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 86%] Built target _TColgp
[ 86%] Built target _TDF
[ 86%] Built target _TDataStd
make: *** [all] Error 2
Timestamp
Wed Jan 14 16:36:44 UTC 2015
Traceback (most recent call last):
  File "run_tests.py", line 22, in <module>
    import core_wrapper_features_unittest
  File "/home/travis/build/tpaviot/pythonocc-core/test/core_wrapper_features_unittest.py", line 23, in <module>
    from OCC.Standard import Standard_Transient, Handle_Standard_Transient
ImportError: No module named OCC.Standard
The command "./.travis.build.sh" exited with 1.
Done. Your build exited with 1.

calling BRep_Tool_Triangulation.GetObject segfaults

as it says on the tin...
probably one to add to the unittest?

        from OCC.BRepPrimAPI import BRepPrimAPI_MakeBox
        from OCC.BRep import BRep_Tool_Triangulation
        from OCC.TopAbs import TopAbs_FACE
        from OCC.TopExp import TopExp_Explorer
        from OCC.TopLoc import TopLoc_Location
        from OCC.BRepMesh import brepmesh
        from OCC.TopoDS import topods_Face

        box = BRepPrimAPI_MakeBox(10, 20, 30).Shape()
        brepmesh.Mesh(box, 0.8)
        # same thing for
        # inc_mesh = BRepMesh_IncrementalMesh(self.box, 0.8)

        ex = TopExp_Explorer(self.box, TopAbs_FACE)
        while ex.More():
            F = topods_Face(ex.Current())
            L = TopLoc_Location()
            facing = (BRep_Tool_Triangulation(F, L))
            # segfaults here...
            facing.GetObject()
            # segfaults
           facing.IsNull()

unify examples & unit test

i think it could be a great ๐Ÿ’Ž idea if we can unify our examples & unit tests

for instance, for the STL example that I just PR'd...
why not a unittest that imports from the example file ( should be a func here ) and runs and validates that an STL file has been exported.

would you consider this a meaningful extension of the test suite?
I recall how in the good ol' days that we took time to wade through the examples before a release.

since we're now on the idea of master == release, i think it actually could make sense

STEP file reader issue.

I am trying to read STEP file using python. Read the installation document file from github and download all the necessary file
( For example.

but problem is that when I am going to use cmake command then I am getting the following error. I am new in python so I am not able to understand how to solve this problem. Is there any easy documentation to run this program means read step file using python.

This is the error when running this cmake command..

D:\software\python\pythonocc-core-master\cmake-build>cmake ..
CMake Warning at CMakeLists.txt:18 (project):
To use the NMake generator, cmake must be run from a shell that can use the
compiler cl from the command line. This environment does not contain
INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to
work.
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:18 (project):
The CMAKE_C_COMPILER:
cl
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.

CMake Error at CMakeLists.txt:18 (project):
The CMAKE_CXX_COMPILER:
cl
is not a full path and was not found in the PATH.

Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred!
See also "D:/software/python/pythonocc-core-master/CMakeFiles/CMakeOutput.log".
See also "D:/software/python/pythonocc-core-master/CMakeFiles/CMakeError.log".

Thanx in advance.

Problems with TColStd_Array1OfInteger_SetValue

Hello everybody,
I'm new to pythonocc and I wanted to create a b-spline with the following code:

from OCC.gp import gp_Pnt
from OCC.TColgp import TColgp_Array1OfPnt
from OCC.TColStd import TColStd_Array1OfInteger, TColStd_Array1OfReal

from OCC.Display.SimpleGui import init_display
display, start_display, add_menu, add_function_to_menu = init_display()

def bspline():
#
array_Pol = TColgp_Array1OfPnt(1, 4)
array_Pol.SetValue(1, gp_Pnt(0, 0, 0))
array_Pol.SetValue(2, gp_Pnt(0.5, 1, 0))
array_Pol.SetValue(3, gp_Pnt(1.5, 1, 0))
array_Pol.SetValue(4, gp_Pnt(2, 0, 0))
num = int(2)
array_Knots = TColStd_Array1OfReal(1, num)
array_Knots.SetValue(1, 0)
array_Knots.SetValue(2, 1)
array_Multi = TColStd_Array1OfInteger(1,num)
array_Multi.SetValue(1,4)
array_Multi.SetValue(2,4)
bspline_1 = Geom_BSplineCurve(array_Pol,array_Knots,array_Multi,3,False)
display.DisplayShape(bspline_1, update=False,color='BLUE')
for j in range(array_Pol.Lower(), array_Pol.Upper()+1):
p = array_Pol.Value(j)
display.DisplayShape(p, update=False)

if name == 'main':
bspline()
display.FitAll()
start_display()

It didn't work and i got the following error message:

Traceback (most recent call last):
File "D:\Dokumente\Python\bSpline1.py", line 48, in
bspline()
File "D:\Dokumente\Python\bSpline1.py", line 39, in bspline
array_Multi.SetValue(1,4)
TypeError: TColStd_Array1OfInteger_SetValue expected 2 arguments, got 3

In my opinion there must be an error with the counter for the arguments, because there is the same problem with the Init member function.

It would be great, if somebody is able to help me.

best regards
Achim

examples refactor

Hi,

So an important issue to further develop is how to go about the examples.
Here are some thoughts.

  • i think it does make sense to group topical ( visualization, geometry, mesh ) in different folders
  • what could be cool is that the folder has a README.md with a screenshot as demonstrated here.
  • currently, most examples have a single function. this is probably a good idea, since its just more clear / less intimidating.
  • i think that with these single-function examples the example should run without the user going through the menu. its not convenient when going through many examples
  • i imagine that the examples/geometry folder might end up with 20, perhaps more files. i suggest that we'll have a examples/geometry/complete.py which imports all examples, and constructs a menu, erasing the viewer going from one example to another. that way, we have fin granularity while still being able to view many examples quickly.
  • nothing stops us from having a examples/complete.py doing the same thing, but creating a menu for every folder examples/ contains. this basically add the menu already created in examples/geometry/complete.py to examples/complete.py
  • that way, you dig through all the examples efficiently, while the code is still granular. remember the long winded examples in the previous repo?. i think its a good idea to move away from that, but I like being able to demo a lot of features in little time and think this is a reasonable way to get to this.
  • having a screenshot in every example folder makes our project look cool... of course the examples/screenshot folder should be located in doc/images/screenshots

Curious to have your thoughts, I'm looking fwd refactoring!

-jelle

Missing some Python OCC module .

In the latest version of pythonOCC-0.16.0-win32-py34 its supporting WEBGGL that's a great one but its showing only one color and also its does not have all the module when I am going to compare this pythonOCC-0.16.0-win32-py34 with pythonOCC-0.4.win32-py2.6.
So my questions are -

  1. How to get the remaining module?
  2. Is it possible to STEP file read with exact color?
    -- Right now step file reading is possible with only one color.
    -- Is it possible to showing exact color using STEPCAFControl this module?

Transform a TopoDS_Edge

Hello!
I didn't find any forum where I can take my questions, so I write here.
I would like to rotate a TopoDS_Edge or Wire object, now I'm using BRepBuilderAPI_Transform for this, but it returns a Shape. If I ask the ShapeType of this object it says thats an Edge (6), but when I put this in the BRepBuilderAPI_MakeWire method, it fails. I hope you can help me, how to make this simple think.

make error Building CXX object CMakeFiles/_AIS.dir/src/SWIG_files/wrapper/AISPYTHON_wrap.cxx.o

Hello
i tryed many times to get Pythonocc run but every time the same issue. Here isthe Terminal output:

paul@paul-MS-7748:~/Downloads/Swig/PythonOCC/pythonocc-core-0.16.0$ sudo make

  1. [ 0%] Building CXX object CMakeFiles/_AIS.dir/src/SWIG_files/wrapper/AISPYTHON_wrap.cxx.o
  2. /home/paul/Downloads/Swig/PythonOCC/pythonocc-core-0.16.0/src/SWIG_files/wrapper
  3. /AISPYTHON_wrap.cxx:4584:32: fatal error: Standard_Failure.hxx: Datei oder Verzeichnis nicht gefunden
    #include <Standard_Failure.hxx>
    ^
    compilation terminated.
    make[2]: *** [CMakeFiles/_AIS.dir/src/SWIG_files/wrapper/AISPYTHON_wrap.cxx.o] Fehler 1
    make[1]: *** [CMakeFiles/_AIS.dir/all] Fehler 2
    make: *** [all] Fehler 2
    In Line 1 the file wrapper is empty and in Line 2 and 3 there is the file AISPYTHON_wrap.cxx without where the Build looks at the same file with a .o at the end.
    On myself iam not able to get working please can anybody help me?

If there are further questions what you need to know please let me know.

Many thanks to you

msys2/mingw64 python3 compile fails like it's not finding python.h

Hi,
I can report I am happily coding away in python2 with pythonocc, but I wanted to get with the times and get it to work with python3.

CMakeFiles/_Adaptor2d.dir/objects.a(Adaptor2dPYTHON_wrap.cxx.obj):
Adaptor2dPYTHON_wrap.cxx:(.text+0x15f51): undefined reference to `__imp__Py_NoneStruct'
C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../x86_64-w64-mingw32/bin/ld.exe: 
CMakeFiles/_Adaptor2d.dir/objects.a(Adaptor2dPYTHON_wrap.cxx.obj):  
bad reloc address 0x100 in section `.data'
collect2.exe: error: ld returned 1 exit status
CMakeFiles/_Adaptor2d.dir/build.make:93: recipe for target 'win64/bin/RELEASE/_Adaptor2d.pyd' failed
make[2]: *** [win64/bin/RELEASE/_Adaptor2d.pyd] Error 1

I reported the reloc address error before and Jelle suggested it is because PYTHON_INCLUDE_DIR is not set properly. This time it is set properly, but alas.

During cmake I see this :

Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: unorderable types: NoneType() >= tuple()

It is quite persistent and no clue where that is coming from. I guessed CMAKE_SWIG_FLAGS where not set to "-py3" so I tried setting manually to no avail.

tips ?

gr.Sander

ImportError: dynamic module does not define init function

I installed pythonocc-core in a virtualenvironment using python 3.4 with is Ubuntu 14.04. No errors came up. I attempted to run the example code from:

http://www.pythonocc.org/quick-examples/hello-dumb-box/

Running the code as is produces the following error. It seems to be attempting to import c-modules that are not designed to be imported. Any thoughts on what I have done wrong.

Traceback (most recent call last):
  File "hello.py", line 2, in <module>
    from OCC.BRepPrimAPI import BRepPrimAPI_MakeBox
  File "/home/derek/.virtualenvs/occ/lib/python3.4/site-packages/OCC/BRepPrimAPI.py", line 32, in <module>
    _BRepPrimAPI = swig_import_helper()
  File "/home/derek/.virtualenvs/occ/lib/python3.4/site-packages/OCC/BRepPrimAPI.py", line 28, in swig_import_helper
    _mod = imp.load_module('_BRepPrimAPI', fp, pathname, description)
  File "/home/derek/.virtualenvs/occ/lib/python3.4/imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
ImportError: dynamic module does not define init function (PyInit__BRepPrimAPI)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.