The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
FILLPOLY_P() Question.
06-30-2021, 11:11 AM
Post: #1
FILLPOLY_P() Question.
I have been trying to use FILLPOLY_P() to fill circles and other more complex shapes, and find that when I plot the points too close together, which obviously better defines the outer shape, then the fill is compromised, and can sometimes result in blank parts not actually filled, or lines outside of the shape, where a corner turns towards the centre.

Does anyone know what algorithm it follows, or how I might avoid badly filled shapes? I am being careful to ensure that the full outline is drawn, with no spaces, but you can take a look at the result and see what I mean.

Code:
EXPORT sham2()
BEGIN
    LOCAL COORD:={};
  LOCAL A,R;
A:=1;
RECT_P(0,0,320,240,0);
      FOR T FROM 0 TO 2*π STEP 0.009 DO
          COORD(A,1):=160+70*COS(T);
          COORD(A,2):=120-70*SIN(T);
//PIXON_P(160+R*COS(T),120+R*SIN(T));
  A:=A+1
      END;
       FILLPOLY_P(G0,COORD,RGB(0,255,0,0),0);
REPEAT 
WAIT (-1);
  IF ISKEYDOWN(4) THEN BREAK(3); END;
 
UNTIL 0;
END;

You can see the example of the code above in the attached screen shot.


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
FILLPOLY_P() Question. - matalog - 06-30-2021 11:11 AM



User(s) browsing this thread: