Loading...
Logo
Processing Forum
Hello all,

I have been conducting a few experiments with the fisica and geomerative libraries to try and create rigid bodies that are infact made up of single characters of text. I first started by using plain jpegs, which if course just built a bounding box around the entire image, and then looked into SVG's but the examples given for SVG usage in fisica+geomerative seem to be very buggy and inconsistent, with the code executing fine, but no images appeared on the canvas and the error

Copy code
  1. Found invalid polygon,
    sides are too close to parallel.

    Didn't add unusable polygon.  Dumping vertices:

    float xv[] = {-0.039218f,-0.039218f,-0.039218f,};
    float yv[] = {0.412512f,0.111878f,0.412512f,};
    Found invalid polygon,
    sides are too close to parallel.
 continually returned.

As a small example I am basically trying to make a bounding box go around the contour of a character. Such as "A". So when added to a physics engine and say fall on it's side the diagonal of the A character would be touching the ground, and not simply appear to have been rotated 90 degrees.


I have tried searching around the forums, and openprocessing.org trying to gain an idea on how to achieve such a thing but to no avail.

If anyone would have any previous attempted or advice to get me started. Cheers.

Replies(1)

Hmm, I think "bounding box" usually means an actual rectangle or rectangular prism (box).   I think what you're describing is leaning toward convex hull territory, which requires some serious math.  The Mesh library says it'll handle that for you, I haven't tried it.