Skip to main content
20-Turquoise
July 22, 2023
Solved

How to fill a quadrilateral with color ?

  • July 22, 2023
  • 2 replies
  • 4689 views

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.

Best answer by ttokoro

Change B and D.

image.pngimage.pngimage.pngimage.pngimage.png

2 replies

ttokoro
21-Topaz I
21-Topaz I
July 22, 2023

Use old hatch function to fill the area.

image.pngimage.png

t.t.
ttokoro
21-Topaz I
21-Topaz I
July 22, 2023

Use 3D plot

image.pngimage.png

t.t.
lvl10720-TurquoiseAuthor
20-Turquoise
July 24, 2023
25-Diamond I
July 23, 2023

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.

25-Diamond I
July 23, 2023

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

 

 

 

lvl10720-TurquoiseAuthor
20-Turquoise
July 24, 2023

   Many thanks for your hints. Werner. 😊 🤔 :

Werner_E_1-1690082440035.png

---

6.png