USER FORUM

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

**greater than/smaller than constraints**

*(by Mamun)*

Hi,

Is there any way I can use some relational operators in the constraints? Actually I would like to set a constraint like - a line segment is greater/smaller than another line segment.

Thanks

Is there any way I can use some relational operators in the constraints? Actually I would like to set a constraint like - a line segment is greater/smaller than another line segment.

Thanks

**(no subject)**

*(by Jonathan Westhues)*

In SolveSpace's constraint model, inequality constraints would always be either redundant (because the solution implied by the other constraints satisfies the inequality) or inconsistent (because that solution doesn't). So they wouldn't be useful, and they're not supported.

What are you trying to do?

What are you trying to do?

**(no subject)**

*(by EvilSpirit)*

it is possible with current solver. it can be performed throguh x - abs(x) for greater/less or min + x * cos(max - min) for ranged. we will support it.

**the problem**

*(by Mamun)*

@Jonathan I am trying to do this - a polygon and a center of a circle is given. my problem is to find out the minimum radius of that circle so that the whole polygon is covered (resides inside the circle).

I need to set a constraint so that every distance between the center and the corner points of the polygon is less than the radius.

Its kind of optimization problem.. and I am new in geometric constraint solving. Is it possible to solve this kind of problem using a geometric constraint solver? Your suggestion will be greatly appreciated.

I need to set a constraint so that every distance between the center and the corner points of the polygon is less than the radius.

Its kind of optimization problem.. and I am new in geometric constraint solving. Is it possible to solve this kind of problem using a geometric constraint solver? Your suggestion will be greatly appreciated.

**(no subject)**

*(by Jonathan Westhues)*

Can you restate the problem? The solution to what you wrote seems trivial, that r is just the maximum of the distances from the given center to any of the given vertices.

**rep:problem**

*(by Mamun)*

@Jonathan oh.. now I see that. the simpler version of my problem is actually trivial.

My original problem is: I have to draw two circles with same center, with radius r_1 and r_2 [r_2 > r_1]. The problem is to find the biggest r_1 and smallest r_2 so that the given polygon is completely outside the smaller circle and completely inside the bigger circle. [Please see the attached pic for clarification]

[Anyway, i can't figure out how to set r to the maximum of the distances from the given center to any of the given vertices? How can I use max/min functions in SolveSpace?]

Sorry for the silly questions, thanks again for your patience.

My original problem is: I have to draw two circles with same center, with radius r_1 and r_2 [r_2 > r_1]. The problem is to find the biggest r_1 and smallest r_2 so that the given polygon is completely outside the smaller circle and completely inside the bigger circle. [Please see the attached pic for clarification]

[Anyway, i can't figure out how to set r to the maximum of the distances from the given center to any of the given vertices? How can I use max/min functions in SolveSpace?]

Sorry for the silly questions, thanks again for your patience.

**(no subject)**

*(by Jonathan Westhues)*

That still doesn't seem like a constraint problem in the sense that SolveSpace uses the word. Isn't r2 just the maximum distance to any edge (which is always the distance to a vertex), and r1 the minimum (which may be the distance to the line or to a vertex)? That's O(n) in the number of edges and involves no numerical methods, as easy as it gets, ignoring the case of center inside polygon of course.

**clarification**

*(by Mamun)*

Hi, I still need to be clear about a few things: -

1) What I have got from your answer is: my problem is not a constraint problem because the solution does not involve any numerical methods. And therefore it can't be modelled in SolveSpace. Did I get it right?

2) Can "optimization problems" be modelled as constraint problem? For instance, following is a modification of my previous problem:

Given a polygon S and a point P. Find two numbers d1 and d2 such that, the ring formed by the circles of radius d1 and d2, centered at P, give the *highest* "cover" of the polygon S.

"Cover" is a ratio defined as:

Area of S fall inside the ring {d1,d2] divided by the area of the ring [d1,d2].

Your comments will be really helpful for my research.

1) What I have got from your answer is: my problem is not a constraint problem because the solution does not involve any numerical methods. And therefore it can't be modelled in SolveSpace. Did I get it right?

2) Can "optimization problems" be modelled as constraint problem? For instance, following is a modification of my previous problem:

Given a polygon S and a point P. Find two numbers d1 and d2 such that, the ring formed by the circles of radius d1 and d2, centered at P, give the *highest* "cover" of the polygon S.

"Cover" is a ratio defined as:

Area of S fall inside the ring {d1,d2] divided by the area of the ring [d1,d2].

Your comments will be really helpful for my research.

**(no subject)**

*(by EvilSpirit)*

The problem you have explain is not seems like optimization problem, but if you know what it is optimization problem, you can not use solvespace for the solution. but you can use solvespace solver. See at R-functions for more information. https://en.wikipedia.org/wiki/Rvachev_function

**what is a solvespace solver?**

*(by Mamun)*

Hi EsvilSpirit, thanks for your suggestion, but what did you mean by "solvespace solver"? is there any document/link on how I can use it?

**(no subject)**

*(by EvilSpirit)*

rvachev functions is about mathematical representation of shapes. you need to solve non-linear system to found optimized solution. solvespace contains symbolic representation of the expressions & contains non linear equations system solver. further work needs sotmething like programmer`s skill to glue up all this together

**(no subject)**

*(by EvilSpirit)*

updated here https://github.com/solvespace/solvespace/issues/81

**Post a reply to this comment:**