The Interactive Geometry Software Cinderella
Forums-> Cinderella Support (E)-> Help with Polygons
johnrpo
|
Help with Polygons
|
|
Dear all,
I am using Cinderella for kinematic modelling of mechanisms. I have a problem I cannot solve (easily).
i) I need to be able to attach a polygon to any link in a mechanism (e.g to the link in the middle in the example of the 3 bar mechanism. The polygon would rotate and translate with such link
ii) I need the user to be able to add a point to this polygon (e.g. by dropping a point on one edge of the polygon. For instance, dropping a point on a line and dragging it outside of the line would draw a triangle, dropping a point on one of the edges of the triangle would draw a 4 sided polygon, etc.
The reason for this is that we need to be able to draw links in the mechanism as polygons with any geometry (not just lines connecting two points).
I currently do this by "hand" by e.g. drawing two circles at the end of each point in the link and finding their intersection. This works fine if the polygon is a triangle, but not if is is a random polygon.
I have noticed that the edges of polygons have no identifiers, and it is difficult to find out if a point is inside a polygon. Perhaps a pointinpolygon function can be added in the future?
Anyway, if any of you can help me solve the problem of (easily) attaching a (random, not regular) polygon to a link that rotates and translates, that´d be a great help. The other behaviour is a "desired" behaviour.
Regards,
John Restrepo
P.S.
Great software, by the way!
|
|
|
|