Python Solvespace
Python library from solver of Solve Space.
Use for academic research and learning.
There hasn't any Solvespace main program but Makefile in the exposed folder (With two OS version).
Feature for CDemo and Python interface can see Here in English.
Or see Here in Chinese.
And there are some code and Solvespace drawing (Also include COMPILED library files) in OS (Windows and Ubuntu) folder.
Requirement
Ubuntu
First, install SWIG. This tool kit can make a Python bundle with C/C++ library.
If your not, install python development kit.
sudo apt install swig python3-devWindows
Download and install SWIG.
Some conflicts between the Microsoft C Language and Python.
You need change a few of Python files to avoid these conflicts.
But you can be assured that the changes won't cause any negative impact.
Python development
If your Python doesn't have development library, like libpython35.a, using gendef to generate it.
First copy python3x.dll to where_your_python\libs folder.
Then using this command:
gendef python3x.dll
dlltool --dllname python3x.dll --def python3x.def --output-lib libpython3x.aAnd then adjust source code about Visual C. Find this code in where_your_python\include\pyconfig.h.
#ifdef _WIN64
#define MS_WIN64
#endifCut them and paste Above this:
#ifdef _MSC_VERFind this code in where_your_python\Lib\distutils\cygwinccompiler.py:
#with MSVC 7.0 or later.
self.dll_libraries = get_msvcr()Commit self.dll_libraries = get_msvcr().
math.h conflict with pyconfig.h
You will definitely get warning with _hypot in pyconfig.h, and you should do this step.
In where_your_python\include\pyconfig.h, find this:
#define hypot _hypotEdit it to this:
#ifndef _MATH_H_
#define hypot _hypot
#endifBuild
makeAnd take out this files:
- _slvs.pyd or _slvs.so
- slvs.py
- libslvs.so