3/31/2023 0 Comments Deltacad fill polygonThe hatch (pattern) should come first so that the outer polygon would be drawn on top of it. Now your background color of the screen should be the face color of the outer polygon. Thankfully, it is possible by using ImageScaled coordinates, which is supported by all 2D primitives. How big the boundary should be? Ideally, it should be always outside of the screen. So what if you put a huge enough rectangle as an outer boundary? Then, your polygon becomes a hole and you can see through stuff behind it. If you see FilledCurve documentation, it supports an object with holes: I don't like it 100%, but still it is usable. you compare only with the end segment of each polylines, not the whole of it.Īdded note (1): To cover the case where your polygon has nearly-vertical edges, the merge process should not look only at y-delta, but allow a merge if any two y range overlaps (that means end of polyline y-range overlap segment y-range).The following solution is hacky work-around to overcome the lack of proper pattern directives.number of global polylines at every step should not be too large,.number of new segments per line scan should not be too high if your polygons do not have zillions of holes,.Optimal algorithm for merging new segments to existing polylines should be easy to find (hashing on y), or a brute force algorithm may suffice: By default, polygons are filled in, but we can make them without a fill as well: sage: polygon2d (1, 2, 5, 6, 5, 0, fill False) Graphics object consisting of 1 graphics primitive. At the end, try to merge again polylines if possible (ends close together).For all segments that you can't merge using that, add a new polyline in the global set. When you merge a segment and a polyline, append a small stretch at the end of the polyline (to joint it to the segment), and the segment itself. For all polylines, and all segments, merge segment + end of polylines (see note 1 below).Intersect vertical line L with your polygon (quick algorithm, easy to find). ![]() ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |