Algorithm – Calculation of the outer polygon

I need to compute an outer polygon from a self-intersecting polygon. I've found that Mathematica has recently implemented the following feature that could solve this problem. Does anyone know how it could be implemented?

https://reference.wolfram.com/language/ref/OuterPolygon.html

Any book or article dealing with this topic would also be helpful.

To illustrate my problem, I have a self-cutting polygon (blue) and want to get the outer polygon (red):

Auto-cutting polygon and outer polygon

If it helps, this polygon is created by "displacing" * a previous polygon that did not overlap itself:

Polygon-term development

Could there be a way to increase the polygon that considers self-overlapping?

Thanks a lot!

* not technically balancing, as only some parts of the polygon move in the normal direction.

Rotation – The polygon does not return in a collision between edge and ground

I'm doing a (basic) physics engine in Python, where a polygon should bounce off the ground ( $ y = 0 $).

When a vertex hits the ground, I apply the (linear) impulse $$ overrightarrow {P} left (0, ; frac {- (1+ epsilon) overrightarrow {n} cdot overrightarrow {v}} { frac {1} {m} + overrightarrow { n} cdot left (I ^ {- 1} ( overrightarrow {r} times overrightarrow {n}) right) times overrightarrow {r}} right) $$
(from where $ overrightarrow {n} (0,1) $ is the normal on the ground, $ overrightarrow {r} $ is a vector from the center of mass to the point of contact and $ epsilon in (0,1) $ is a constant of elasticity)

In my code:

class POLYGON:
    def bounce(self):
        #Checks whether the polygon is under the ground and rebounces it if necessary

        #Finds the nodes with y <= 0
        low_nodes = ()
        for node in self.nodes:
            if node(1) < 0:
                low_nodes.append(node)

        if len(low_nodes) > 0:
            #Translates the polygon above the ground
            lowest_node = low_nodes(np.argmax(low_nodes,axis=0)(1))
            self.translate((0, (1+restituence_constant)*(-lowest_node(1))))

            #Makes a list of the (linear) velocities of all low nodes
            speed = ()
            for node in low_nodes:
                speed.append(self.getLinearVelocity(node))

            for (i,node) in enumerate(low_nodes):
                r = node - self.pos

                ut = -(1+restituence_constant) * speed(i)(1)
                lt = 1/self.mass + 1/self.rot_inertia * cross(r(0), r)(1)
                j = ut/lt
                impulse = (0, j/len(low_nodes))
                self.applyLinearImpulse(impulse, node)

As a side note: I create the list of linear velocities of the nodes in advance, since these are influenced by applying impulses.
It is also necessary to divide the length of the size of the pulse by the number of "low nodes".

If only one vertex hits the ground, everything works fine.
But in a collision between edge and ground I find the impulses too small.

If I drop the square with knots $ ( pm100, pm100) $it does not even jump!
But if I drop the polygon with knots $ ( pm10, -100) $ and $ ( pm100,100) $ On the "small side" the impulse is big enough to bounce back.
Therefore, I come to the conclusion that the problem is caused by the vertices being too far from the center of mass $ x $-Direction.

My question is: how can I fix this?
My first idea was to replace the impulses at the vertices with a linear impulse in the middle of the edge. However, this seems a bit "hacky" and mathematically incorrect.
Could you please help me?

Rotation – polygon jumps off the ground

NOTE: You may want to read the calculations here (on the Physics Stack Exchange website) because I can insert LaTeX equations inline there.

I'm doing a physics simulator right now, but I'm having some trouble bouncing a polygon off the ground.

What I'm trying to do:
When the polygon touches the ground, I want to apply a linear pulse Enter image description here at the point of contact, so that the energy E & # 39; of the polygon after the rebound is a certain elasticity constant (!) Enter image description here (2)) (2) times the energy E of the polygon before the rebound.
$$ E & # 39; = epsilon E $$

My calculations:
Imagine a Cartesian coordinate system in which the ground is y = 0. Then (! (Insert image description here) (3)) (3) where we expect p to be positive.
m, I, $ overrightarrow {v} $, $ overrightarrow { omega} $ and $ overrightarrow {r} $ are given, and we want to calculate the size p of the impulse $ overrightarrow {P} $.
$$ frac {1} {2} m cdot overrightarrow {v & # 39;} ^ 2 + frac {1} {2} cdot overrightarrow { omega & # 39;} ^ 2 = E & # 39; = epsilon E = epsilon cdot left ( frac {1} {2} m cdot overrightarrow {v} ^ 2 + frac {1} {2} I cdot overrightarrow { omega } ^ 2 right) $$
$$ Leftrightarrow m cdot left ( overrightarrow {v} + frac { overrightarrow {P}} {m} right) ^ 2 + I cdot left ( overrightarrow { omega} + frac { overrightarrow {r} times overrightarrow {P}} {I} right) ^ 2 = epsilon cdot left (m cdot overrightarrow {v} ^ 2 + I cdot overrightarrow { omega} ^ 2 right) $$
$$ Leftrightarrow m cdot overrightarrow {v} ^ 2 + 2 overrightarrow {v} cdot overrightarrow {P} + frac { overrightarrow {P} ^ 2} {m} + I cdot overrightarrow { omega} ^ 2 + 2 overrightarrow { omega} cdot ( overrightarrow {r} times overrightarrow {P}) + frac {( overrightarrow {r} times overrightarrow {P}) ^ 2} {I} = epsilon cdot left (m cdot overrightarrow {v} ^ 2 + I cdot overrightarrow { omega} ^ 2 right) $$

And now we can use the fact that $ overrightarrow {P} (0, p) $, to calculate the point and cross products:
$$ 0 = (1 epsilon) cdot left (m cdot overrightarrow {v} ^ 2 + I cdot overrightarrow { omega} ^ 2 right) + 2p cdot v (1) + frac {p ^ 2} {m} + 2p cdot r (0) cdot | overrightarrow { omega} | + frac {(p cdot r (0)) ^ 2} {I} $$
$$ Leftrightarrow left ( frac {1} {m} + frac {r (0) ^ 2} {I} right) cdot p ^ 2 + left (2v (1) + 2r (0) cdot | overrightarrow { omega} | right) cdot p + (1- epsilon) cdot left (m cdot overrightarrow {v} ^ 2 + I cdot overrightarrow { omega} ^ 2 right) $$

This is a quadratic equation in $ p $.
If we hire:

  • $$ A = frac {1} {m} + frac {r (0) ^ 2} {I} $$
  • $$ B = 2v (1) + 2r (0) cdot | overrightarrow { omega} | $$
  • $$ C = (1 epsilon) cdot left (m cdot overrightarrow {v} ^ 2 + I cdot overrightarrow { omega} ^ 2 right) $$
  • We can calculate the determinant $$ D = B ^ 2-4AC $$,

    Now it is clear that $$ p = frac {-B + sqrt {D}} {2A} $$

    When I do this in a simulation, it looks very natural.
    However, there are always problems when D <0.
    I've tried to solve this problem in countless ways (*)but it never worked out well.

    Can someone check if my method and calculations are correct?
    And if not, how can I model this collision instead?

    Here's a snippet of my code (in Python):

    class POLYGON:
        def bounce(self):
            #Checks whether the polygon touches the ground and makes it rebound if necessary
    
            low_nodes = ()    #makes a list of the nodes with y<0
            for node in self.nodes:
                if node(1) <= 0:
                    low_nodes.append(node)
    
            if len(low_nodes) >= 1:
                speed = self.speed
                self.translate((0, -2*lowest_node(1))    #lifts the lowest node above the ground
    
                for node in low_nodes:
                    r = node - self.pos    #calculates r
    
                    A = 1/self.mass + r(0)**2/self.rot_inertia
                    B = 2*self.speed(1) + 2*self.rot_speed*r(0)
                    C = (1-restituence_constant) * (self.mass*np.linalg.norm(self.speed)**2 + self.rot_inertia*self.rot_speed**2)
                    D = B**2 - 4*A*C
    
                    if D<0:
                        impulse = (0, -B/(2*A)
                    else:
                        impulse = (0, (-B-np.sqrt(D)) /(2*A) /len(low_nodes))
                    self.applyLinearImpulse(impulse, node)
    

    (*)
    For example:
    using the absolute value of D
    Consider $ p $ as a complex number and apply the impulse $ (Im (p), Re (p)) $
    Set $ ​​p = frac {-B} {2A} $ if $ D <0 $
    ...

    gis – QGIS – Displays polygon values ​​as points

    I've created a polygon shapefile and imported a CSV (with CSVT) into QGIS. The two layers were joined based on the polygon IDs and saved as a new polygon layer. I try to visualize the CSV values ​​by the columns in the assigned polygons by projecting them into the polygons in a random spatial manner (without geometry). I've done this before but can not figure out how to do it now … Thanks for your help!

    Computational Geometry – Algorithm for decomposing a complex (self-intersecting) polygon into simple polygons

    I've tried to write a Bentley-Ottmann sweepline algorithm to turn a self-intersecting (complex) set into a set of simple polygons.

    There are some instructions on this page (see the heading "Split into simple parts"), but my current implementation is inadequate (see screenshot below).

    current result

    Although I am able to find all self-intersecting points, I can not construct the desired outputs if there are several self-intersecting points in a single segment.

    I'm struggling to find other papers that describe the process or the required data structures in more detail. The blog post references a linked list that could mean a double-linked edge list, although I'm not 100% sure. The other challenge is that I believe that there is no appropriate implementation of this data structure.

    Any advice on how to reconstruct the output I want would be appreciated

    fa.functional analysis – Which polygon describes its unity sphere given the given composite norm?

    Note: This is very similar to my question about Math.Se, which has not yet received any answers.

    It is known that for each centrally symmetric convex polygon $ A $ There is a norm $ | cdot | $whose unit sphere is $ A $namely $ | x | = inf {t> 0: frac {x} {t} in A } $,
    But how about the reverse, assuming a "composite" norm?
    $$
    | cdot |
    : = sum_ {k in mathbb {N}} alpha_k | cdot | _k,
    $$

    on a vector space $ V $, from where $ sum_ {k in mathbb {N}} alpha_k = 1 $so that the norm converges and the $ {i_k } _ {k in mathbb {N}} $ only an index for the standards used, What can we say about the unit sphere, which is centered at zero in terms of $ | cdot | $. $ mathscr {B}: = { omega in V: | | omega | <1 } $,

    It is clear that a polygon with an odd number of vertices can not occur due to the symmetry of the norm.

    Unity – instantiate enemies (triangles) in the form of an n-sided polygon

    You already have a vector in the middle that you use to make the position! Just orient yourself to point in that direction look rotation, : D

    for (int i = 0; i <formation.count; i ++)
    {
    Float angle = i / (Formation.Count * 2f * Mathf.PI);
    Vector3 fromCenter = new Vector2 (Mathf.Sin (angle), Mathf.Cos (angle));
    Vector2 position = center + radius * of center;
    Quaternion orientation = Quaternion.LookRotation (Vector3.forward, fromCenter);
    GameObject tri = instantiate (prefab, position, alignment, parent) as GameObject;
    }
    

    Here I assume that the "nose" of your triangle points in the local y + direction. If it points in a different direction, you can apply an additional rotation to make sure the nose is sticking out instead of z. B. clockwise.

    dg.differential geometry – About the number of intersections of a knotted polygon with a plane. (Milnor's paper)

    I try to understand the article "About the total curvature of knots" by John.W.Milnor. Here is the free access to the article.


    The last sentence in this work indicates that for every knotted polygon in $ mathbb {R} ^ {3} $ With $ mu < infty $ There is a plane that intersects the polygon in at least 6 points. By the proof of the theorem the author designates the polygon with $ P $ After a few steps, he divides the polygon into two polygons $ P_ {1} $ and $ P_ {2} $ so that $ P_ {1} $ is linked with fewer pages than $ P $ and then prove the sentence. My question is, as the author has claimed $ P_ {1} $ has fewer pages than $ P $?

    Thanks in advance for your help.

    Geometry – Calculates if the inside of a polygon is to the right or left of a particular edge

    I'm trying to implement the polygon triangulation algorithm presented in Chapter 3 of the book Computer Geometry, Algorithms and Applications, 3rd ed, in my program.
    The algorithm processes simple polygons.

    Part of the algorithm requires knowledge of whether the interior of this polygon is to the right of a particular edge or not. I do not think the solution to this problem is included in the book, and I did not manage to solve it myself or find an answer. What is a fast and robust way to determine these given vertices using floating-point coordinates?

    js

    BlackHatKings: Crypto speculation and investment
    Posted by: MervinROX
    Post Time: June 20, 2019 at 1:38 pm.