Skip to main content
20-Turquoise
Jul 22, 2023 9:42 PM UTC
Solved

How to fill a quadrilateral with color ?

Hello Everyone.
From :
Fill_Quadrilateral.png
How to fill the ( convex, concave, complex ) quadrilateral with color ?
Thanks in advance for your time and help.
Best Regards.
Loi.

ttokoro
ttokoroAnswer
21-Topaz I
Jul 23, 2023 2:29 AM UTC

Change B and D.

image.pngimage.pngimage.pngimage.pngimage.png

t.t.

18 replies

ttokoro
21-Topaz I
Jul 22, 2023 11:17 PM UTC

Use old hatch function to fill the area.

image.pngimage.png

Translate
t.t.
ttokoro
21-Topaz I
Jul 22, 2023 11:53 PM UTC

Use 3D plot

image.pngimage.png

Translate
t.t.
lvl10720-TurquoiseAuthor
20-Turquoise
Jul 24, 2023 12:01 AM UTC
Werner_E
25-Diamond I
Jul 23, 2023 12:57 AM UTC

Maybe the work of Prof. Birkeland can help, too.

See attachment in this posting: https://community.ptc.com/t5/Mathcad/How-to-fill-the-area-under-the-curve-with-colours/m-p/888943/highlight/true#M207711

 

As you are using real Mathcad you probably are rather interested in the predecessor for Mathcad 15. Its attached here.

 

BTW, four lines do NOT define a unique quadrilateral as you can see here:

Werner_E_0-1690076732435.png

Better you provide the vertices and keep in mind, that the order in which you provide the points matter!

 

To use Prof. Birkeland's functions you will have to provide a boolean function which determines if a point is inside the to-be-hatched area or not.

I vaguely remember that I provided that kind of "pointInPolygon" function in an older thread for a different purpose, but it seems that I did not keep a copy and I could not find that thread with a quick search.

Translate
Werner_E
25-Diamond I
Jul 23, 2023 3:30 AM UTC

Birkeland provides three functions to fill shapes in his worksheet, Dots, Hatch and Shade.

Dots is the most simple one and can be used to fill arbitrary polygons with an orthogonal dot grid. Varying the number of dots and their size you may also simulate a plain fill.

Werner_E_1-1690082440035.png

After quite some reformatting it worked in Prime, too, but unfortunately Prime is limited concerning the number of different line widths (=point sizes in Prime) and the number of points its can plot while respecting the set line width, The center plot with about 17000 points won't work OK because of this limitation and the number of dots had to be reduced.

Werner_E_2-1690082859414.png

 

 

 

Translate
lvl10720-TurquoiseAuthor
20-Turquoise
Jul 24, 2023 1:12 AM UTC

   Many thanks for your hints. Werner. 😊 🤔 :

Werner_E_1-1690082440035.png

---

6.png

 

Translate