polygon

Polygon with rounded corners using UIBezierPath

青春壹個敷衍的年華 提交于 2019-12-14 04:16:59
问题 I would like to use UIBezierPath to create a polygon shape with rounded corners. I believe this will be possible using addCurveToPoint:controlPoint1:controlPoint2: and similar code to that found in http://www.codeproject.com/Articles/31859/Draw-a-Smooth-Curve-through-a-Set-of-2D-Points-wit, but I was wondering if there's any existing (or better) way to achieve this? I should point out that this will need to be for any convex polygon (such as found in a voronoi diagram) and not just a

Google maps polygon optimization

流过昼夜 提交于 2019-12-14 04:16:54
问题 I extracted country outline data from somewhere and successfully managed to convert it into an array of lat-lng coordinates that I can feed to Google maps API to draw polyline or polygons. The problem is that that there are about 1200+ points in that shape. It renders perfectly in Google maps but I need to reduce the number of points from 1200 to less than 100. I don't need a very smooth outline, i just need to throw away the points that I can live without. Any algorithm or an online tool

ArrayIndexOutOfBoundsException error while drawing a polygon

假装没事ソ 提交于 2019-12-14 04:00:31
问题 hi there i'm having a trouble while i'm trying to draw a polygon. first of all, when i try to draw a polygon with using addPoint(int x, int y) method and giving coordinates one by one there is no problem, polygon could be drawed perfectly. however, if i give the coordinates as an array (an integer array for x coordinates and y coordinates) compiler gives error. this is the working code as you can see, @Override public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; Polygon poly = new

How to make MarkerClusterGroup cluster polygons

痴心易碎 提交于 2019-12-14 03:54:59
问题 I am trying to show clusters using markerclustergroups with Polygons. Right now the polygons are shown but the clusters aren't. I have been trying to use center of mass for the polygons because it seems like markerclustergroup doesn't like polygons but that doesn't really work since the animation of markerclustergroup will be set on the centroids and not the actual polygon. My polygons all vary in amount of coordinates. Some have +10 sets others have 3. How would I use markerclustergroup for

WPF, Polygon and Poly

↘锁芯ラ 提交于 2019-12-14 03:53:32
问题 I'm building an aplication C# with WFP, I'm trying to draw shapes, each shape belongs to a class and such class contains a Polygon for the outer shape, and 1 to 3 Polylines to make it look like real 2D object, this way I can change some properties of the whole shape on the fly (Colors, Visibility, etc) I must say that some Polylines are created by a loop according to the desired height and width but righ now I'm facing a probem with the render of some PolyLines If you use paint to represent

GPC Polygon Initialization

跟風遠走 提交于 2019-12-14 01:48:32
问题 I am using the GPC Polygon Clipping lib and want to create a polygon programatically. I only see code for how to create one from a file. How can I do the initialization in my code? 回答1: Read better from your link, find the doc page and read; in particular gpc_add_contour function is likely what you need. The struct gpc_vertex_list holds a pointer to gpc_vertex-s and the number of vertex, and is what you must fill in. Like gpc_polygon p = {0, NULL, NULL}; // "void" polygon gpc_vertex v[] = {

SVG - polygon hover does not work correclty [duplicate]

梦想的初衷 提交于 2019-12-14 01:26:31
问题 This question already has answers here : Css hover sometimes doesn't work on svg paths (3 answers) Closed 3 years ago . As you can see on gif below, :hover state does not work properly when I move the mouse cursor from bottom polygon to upper polygon: [jsfiddle] Tested in Chrome and Firefox - the result is the same. How can I achieve SVG polygon turn :hover state on right after mouse cursor enters its borders? 回答1: There is no fill to catch the pointer event so it fails. A simple transparent

Shapely intersection: parallel planes

浪尽此生 提交于 2019-12-14 01:22:33
问题 I'm working on determining relationships (boundary/interior intersections) between two 3D objects (triangular faces) and stumbled on Shapely, which I am interested in using instead of implementing my own point/segment/ray/triangle intersection functions. However, I'm running into the following problem: >>> from shapely.geometry import Polygon >>> poly = Polygon([(0,1,1),(1,-1,1),(-1,-1,1)]) >>> poly2 = Polygon([(0,1,0),(1,-1,0),(-1,-1,0)]) >>> poly.intersects(poly2) True >>> poly.equals(poly2

Mysql geometry AREA() function returns what exactly when coords are long/lat?

China☆狼群 提交于 2019-12-13 19:26:54
问题 My question is somewhat related to this similar one, which links to a pretty complex solution - but what I want to understand is the result of this: Using a Mysql Geometry field to store a small polygon I duly ran select AREA(myPolygon) where id =1 over it, and got an value like 2.345. So can anyone tell me, just what does that number represent seeing as the stored values were long/lat sets describing the polygon? FYI, the areas I am working on are relatively small (car parks and the like)

Calculate Convex Hull of points from a set of (lat/long) points

我们两清 提交于 2019-12-13 18:34:11
问题 I am working on a web app with Google Map that I’d like to display a “coverage area”/’ geographical area” by creating a polygon overlay of a given set of geo coordinates/points. The “coverage area” can consist of thousands of the geo coordinates (Longitude and Latitude data stored in a table in sql server). Ideally, I’d like to calculate the Convex Hull points from the sql server database (2008 R2) so I can pass the results (points) to the Google Map to create the polygon overlay. The sample