SolveSpace Logo SOLVESPACE -- parametric 2d/3d CAD
Examples
Tutorials
Features
Download
Reference
Technology
Library
Forum
Contact
USER FORUM

(you are viewing a thread; or go back to list of threads)

Error % per Solve Cycle (by Tom Sato)
Hi Jonathan,

I'm having trouble understanding how recovery takes place when a gap is produced by dragging a point. For example, a point is constraint to a circle. As the point moves, a gap starts to exists between the point and the circle. The solver should then move the circle towards the point to maintain the constraint. However, the tests I'm running shows that the circle moves towards the point, but recovers only between 30% and 50% of the gap.
Here's a simple test:

Dim gt As UInteger = 1
Dim vOrigin As Point3d = NewPoint3d(gt, 0.0, 0.0, 0.0)
Dim vNormal As Normal3d = NewNormal3d(gt, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0)
Dim vWorkplane As Workplane = NewWorkplane(gt, vOrigin, vNormal)

Dim P1 As Point2d = NewPoint2d(gt, vWorkplane, 0.0, 1.1)
Dim P2 As Point2d = NewPoint2d(gt, vWorkplane, 1.0, 1.0)
Dim Center As Point2d = NewPoint2d(gt, vWorkplane, 0, 0)

Dim S1 As LineSegment = NewLineSegment(gt, vWorkplane, P1, P2)
Dim C1 As Circle = NewCircle(gt, vWorkplane, Center, vNormal, NewDistance(gt, vWorkplane, 1.0))

AddConstraint(1, gt, ConstraintEnum.PT_ON_CIRCLE,vWorkplane.H, 0, P1.H, 0, C1.H, 0)

Solve(gt, P1, True)

Given that P1.V=1.1 and Radius=1.0, then the Center.V should move up to 0.1 to satisfy, but instead, it moves to 0.052306 (47% error). A gap of 1 unit produces an error of (34.9%). The error is obviously almost halved with every iteration, so should I run for multiple iterations until the system is stable, and is there an accumulative error value I can refer to to determine when to stop iterating. I just feel like I'm missing something.

Many thanks,
Tom
Thu May 28 2015, 20:08:53
(no subject) (by Jonathan Westhues)
Why do you expect the solver to move just P1.v, instead of P1.u or the radius of the circle? They're all in the group being solved.
Fri May 29 2015, 03:24:37
(no subject) (by Tom Sato)
Many thanks, and you just solved my problem. I just never thought of the radius being a variable to be solved as well, and obviously it is. Everything is working perfectly now.

Tom.
Fri May 29 2015, 12:54:38
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):
© 2008-2022 SolveSpace contributors. Most recent update June 2 2022.