Merge pull request #8 from costika1234/fix_ratio_constraints

Fixed ratio constraints.
pull/493/head
Yuan 2021-02-12 11:00:50 +08:00 committed by GitHub
commit 2507775023
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -24,10 +24,10 @@ Build and install the module:
python setup.py install python setup.py install
``` ```
Run unit test: Run unit tests:
```bash ```bash
python tests python test
``` ```
Uninstall the module: Uninstall the module:

View File

@ -801,8 +801,7 @@ cdef class SolverSystem:
if wp is _E_FREE_IN_3D: if wp is _E_FREE_IN_3D:
raise ValueError("this is a 2d constraint") raise ValueError("this is a 2d constraint")
if e1.is_line_2d() and e2.is_line_2d(): if e1.is_line_2d() and e2.is_line_2d():
self.add_constraint(SLVS_C_EQ_PT_LN_DISTANCES, wp, value, _E_NONE, self.add_constraint(SLVS_C_LENGTH_RATIO, wp, value, _E_NONE, _E_NONE, e1, e2)
_E_NONE, e1, e2)
else: else:
raise TypeError(f"unsupported entities: {e1}, {e2}, {wp}") raise TypeError(f"unsupported entities: {e1}, {e2}, {wp}")