0
$\begingroup$

I have a circle object within a triangle that I have previously been moving based on a mathematical constraint like so

positions.append(get_triangle_constraints([(0,0,0),(5,0,0),(2.5,5,0)]))

where the positions array corresponds with the circles possible points.

However I want to abstract this so have been trying to create a shrinkwrap constraint based on the triangle that would allow me to remove the mathematical constraints. My question is how can I tell the positions array you see above to append only points based on the constraint? Or is there another, more optimal way to iterate through a positions array when using a shrinkwrap constraint?

Below you can see the triangle and circles I am talking about. I currently constrained the circles by using line equations from the triangles vertices but would like to use a shrinkwrap constraint in a python script. Any help would be appreciated.

Triangle with math constraints

$\endgroup$
7
  • 1
    $\begingroup$ Please add images to your question to clarify your intention. $\endgroup$
    – kheetor
    May 17 '18 at 14:14
  • $\begingroup$ I have edited to show you an example of triangles and circles $\endgroup$
    – sf8193
    May 22 '18 at 20:14
  • $\begingroup$ What you are trying to do is still pretty unclear. You want to find random positions inside a triangle? You have 3D coordinates but "triangle" and 3 points only constitute a flat triangle? You want the points ON this triangle face? You could use particle system for instance. Do you want to have these exact points but to "clamp" them to the triangle that you plan to move somehow? $\endgroup$
    – kheetor
    Jun 4 '18 at 7:51
  • $\begingroup$ @kheetor these points move around the triangle in a simulation, but they need to be constrained to stay within the triangle. For sake of clarity, this means they can be at any place in the triangle at any time, as long as they don't leave it's bounds. The triangle will not move but the 3 circles do move within the triangle. $\endgroup$
    – sf8193
    Jun 4 '18 at 16:18
  • 1
    $\begingroup$ When making a simulation, wouldn't it make sense to constraint them to the specified area or volume via actual physics since there are built-in solutions for managing and baking simulations? This is not exactly my area of expertise though. $\endgroup$
    – kheetor
    Jun 5 '18 at 8:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.