78 lines
3.6 KiB
Plaintext
78 lines
3.6 KiB
Plaintext
TODO/WISH LIST
|
|
--------------
|
|
|
|
Code: Some bits of the code are ugly:
|
|
- vector module, matpy module and Numpy package, all offer similar
|
|
functionality. Use only one (numpy), get rid of two.
|
|
- more documentation!
|
|
|
|
Speed: The solver is currently much too slow. The problem is the pattern
|
|
matching algorithms that is used to find combinations of clusters that
|
|
can be rewritten/merged. Solutions:
|
|
- incremental pattern matching system (work in progress)
|
|
- compliled implementation (Psycho/C++/Haskell/???)
|
|
|
|
Rules: More rewrite rules to increase the problem domain:
|
|
- need 2d and 3d rules for merging radial clusters
|
|
2D:H+H->H sharing center and 1 point
|
|
3D:H+H+H-> sharing center and 3 points, 2 points per pair of hogs
|
|
3D:H+H->H sharing center and 2 points (local overconstrained)
|
|
- need 3d rule: merge of 2 rigids with 2 shared points (hinge) + hog with angle not on hinge points
|
|
- larger subproblems (octahedron, variable radius spheres/cylinders)
|
|
- new clusters types (N degrees of freedom)
|
|
|
|
Extentions:
|
|
- implement geometry: lines, planes, spheres, cylinders, tori (mappings to
|
|
cluster)
|
|
- add constraints on parameters (equality, algebraic constraints)
|
|
- add other variable domains (integers, reals, n-dimensional points,
|
|
surfaces, volumes, logic variables, lists)
|
|
- hybrid with other solving methods: and-propagation, iterative solvers, etc.
|
|
|
|
BUGS:
|
|
|
|
- prototype based selection doesn't seem to work on line mappings
|
|
|
|
- stop problem from rotating and jumping around when there are no fixed points. It should
|
|
be as close to the prototype as possible;
|
|
should have at least have one (2d) or two(3d) edge(s) with the same offset and orientation.
|
|
|
|
- following should be well-constrained, but gives underconstrained (need extra rule/pattern)
|
|
def diamond_3d():
|
|
"""creates a diamond shape with point 'v1'...'v4' in 3D with one solution"""
|
|
L=10.0
|
|
problem = GeometricProblem(dimension=3)
|
|
problem.add_point('v1', vector([0.0, 0.0, 0.0]))
|
|
problem.add_point('v2', vector([-5.0, 5.0, 0.0]))
|
|
problem.add_point('v3', vector([5.0, 5.0, 0.0]))
|
|
problem.add_point('v4', vector([0.0, 10.0, 0.0]))
|
|
problem.add_constraint(DistanceConstraint('v1', 'v2', L))
|
|
problem.add_constraint(DistanceConstraint('v1', 'v3', L))
|
|
problem.add_constraint(DistanceConstraint('v2', 'v3', L))
|
|
problem.add_constraint(DistanceConstraint('v2', 'v4', L))
|
|
problem.add_constraint(DistanceConstraint('v3', 'v4', L))
|
|
# this bit of code constrains the points v1...v4 in a plane with point p above v1
|
|
problem.add_point('p', vector([0.0, 0.0, 1.0]))
|
|
problem.add_constraint(DistanceConstraint('v1', 'p', 1.0))
|
|
problem.add_constraint(AngleConstraint('v2','v1','p', math.pi/2))
|
|
problem.add_constraint(AngleConstraint('v3','v1','p', math.pi/2))
|
|
problem.add_constraint(AngleConstraint('v4','v1','p', math.pi/2))
|
|
|
|
- when fixed (by swapping v1 and v3 in last bit of code)
|
|
sometimes raises:
|
|
StandardError: more than one candidate prototype cluster for variable v2
|
|
or:
|
|
FixConstraint(v2=[-5.0, 5.0, 0.0]) not satisfied
|
|
FixConstraint(v1=[0.0, 0.0, 0.0]) not satisfied
|
|
|
|
- 2D deriveADD accepts this pattern, but fails during execution.
|
|
Angle(p3,p2,p4)
|
|
Rigid(p1,p2,p4)
|
|
Distance(p1,p3)
|
|
Note: this pattern can be solved only in 2D. To keep DeriveADD general
|
|
(and simple), pattern matching should be more strict, allowing only
|
|
patterns where the angle constraint is in the derived triangle.
|
|
An extra rule is needed to merge two angles (radial clusters) in 2D.
|
|
In 3D, three radial clusters can be merged.
|
|
|