3
$\begingroup$

I'm trying to create the following geometric scene:

G = RandomInstance[GeometricScene[{a,b,c,d,m,n,p,q,α,β,γ,δ}, { 
   Polygon[{a,b,c,d}],
   m==Midpoint[{a,b}],      
   n==Midpoint[{b,c}],      
   p==Midpoint[{d,c}],          
   q==Midpoint[{a,d}],
   {Line[{a,α,β,n}],Line[{m,α,δ,d}]},      
   {Line[{a,α,β,n}],Line[{b,β,γ,p}]},
   {Line[{c,γ,δ,q}],Line[{b,β,γ,p}]},      
   {Line[{d,δ,α,m}],Line[{c,γ,δ,q}]},
   Polygon[{α,β,γ,δ}],
   Polygon[{c,γ,p}],
   Polygon[{d,δ,q}],       
   Polygon[{a,α,m}],      
   Polygon[{b,β,n}]
  }
]]

But for some reason, when I add these polygons in the end:

Polygon[{α, β, γ, δ}],
Polygon[{c, γ, p}],
Polygon[{d, δ, q}],       
Polygon[{a, α, m}],      
Polygon[{b, β, n}]

It won't work. Is there a reason for this?

$\endgroup$
2
  • $\begingroup$ For me, G produces 10 points belonging to the same line ( a degenerate case ). $\endgroup$
    – user64494
    Commented Sep 18 at 19:07
  • $\begingroup$ @user64494 Sometimes it behaves like that. I don't know why, $\endgroup$
    – Red Banana
    Commented Sep 19 at 0:12

1 Answer 1

8
$\begingroup$
  • Since Polygon not always be a Convex Polygon. We add GeometricAssertion[Polygon[......], "Convex"]
G = RandomInstance[
  GeometricScene[{a, b, c, d, m, n, p, 
    q, α, β, γ, δ}, {Polygon[{a, b, c, d}],
     m == Midpoint[{a, b}], n == Midpoint[{b, c}], 
    p == Midpoint[{d, c}], 
    q == Midpoint[{a, d}], {Line[{a, α, β, n}], 
     Line[{m, α, δ, d}]}, {Line[{a, α, β, 
       n}], Line[{b, β, γ, 
       p}]}, {Line[{c, γ, δ, q}], 
     Line[{b, β, γ, p}]}, {Line[{d, δ, α, 
       m}], Line[{c, γ, δ, q}]}, 
    GeometricAssertion[
     Polygon[{α, β, γ, δ}], "Convex"], 
    GeometricAssertion[Polygon[{c, γ, p}], "Convex"], 
    GeometricAssertion[Polygon[{d, δ, q}], "Convex"], 
    GeometricAssertion[Polygon[{a, α, m}], "Convex"], 
    GeometricAssertion[Polygon[{b, β, n}], "Convex"]}]]

enter image description here

$\endgroup$
4
  • $\begingroup$ Yes! This was also something I was trying to learn, the original figure I wanted was a quadrilateral, this willl solve all my problems. $\endgroup$
    – Red Banana
    Commented Sep 19 at 13:01
  • 1
    $\begingroup$ It's enough GeometricAssertion[Polygon[a, b, c, d}], "Convex"] instead of 5 assertions $\endgroup$
    – user64494
    Commented Sep 19 at 17:45
  • $\begingroup$ @user64494 Yes, I also test this. But from outside to inside is different to from inside to outside. $\endgroup$
    – cvgmt
    Commented Sep 20 at 0:36
  • $\begingroup$ @cvgmt: Can you elaborate your "from outside to inside" and "from inside to outside", giving us details? $\endgroup$
    – user64494
    Commented Sep 20 at 6:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.