pathgeometry

What's the opposite of polygon triangulation?

↘锁芯ラ 提交于 2020-01-11 10:15:32
问题 After I've done a 2D triangulation, some triangles have the same color and I want to recombine them for drawing into like-colored graphics paths. I find that if I just draw the triangles one by one, some graphic renderers shows seams between the triangles (at least if anti-aliasing and/or transparency is involved). So how do I take a set of (non-overlapping) triangles and produce a graphics path, which may contain holes and disjoint polygons? Blindly adding the triangles to a graphics path

How can I get paths in a WPF GeometryGroup correctly aligned?

梦想与她 提交于 2020-01-05 07:17:07
问题 I am using a GeometryGroup to draw a symbol in the center of a circle. The example below shows one of my attempts while experimenting with this. It features three straight lines that depart from the same point of origin (32,32): <Grid> <Path Stroke="Black" StrokeThickness="1" Width="64" Height="64" Fill="Yellow" VerticalAlignment="Top" HorizontalAlignment="Left" ClipToBounds="True"> <Path.Data> <GeometryGroup> <EllipseGeometry Center="32,32" RadiusX="32" RadiusY="32"/> <PathGeometry Figures=

Get path geometry from image

自古美人都是妖i 提交于 2020-01-01 02:04:09
问题 If i have a logo, let's say done as a jpg or even a png. Any suggestion for how I can use that to define a path geometry? It would be really good if any suggestions could be provided for how i can do it in blend. Thanks 回答1: Yes - I just tackled this problem for an LOB application two days ago. I can't offer advice for Blend (though I've read that it can be done in Expression Designer). However, the best free tool I've found for this is called InkScape (http://www.inkscape.org). It's

Algorithm to split self-intersected Path2D into several not self-intersected paths?

荒凉一梦 提交于 2019-12-31 23:13:10
问题 I need to get rid of self-intersections in a shape. Shape is constructed from an array of points, so all segments of that shape are lines. ( only lines, no curves and arcs) Previously, I tried to create Path2D from that points, construct an Area from it, and then using its PathIterator I created several Path2Ds, which somehow were subpaths of previous path, and so self-intersetions were gone. But this isn't working for some paths - self-intersections still remain there. So could you point me

Algorithm to split self-intersected Path2D into several not self-intersected paths?

早过忘川 提交于 2019-12-31 23:10:03
问题 I need to get rid of self-intersections in a shape. Shape is constructed from an array of points, so all segments of that shape are lines. ( only lines, no curves and arcs) Previously, I tried to create Path2D from that points, construct an Area from it, and then using its PathIterator I created several Path2Ds, which somehow were subpaths of previous path, and so self-intersetions were gone. But this isn't working for some paths - self-intersections still remain there. So could you point me

Getting length of a PathGeometry (lines) in C#/WPF

谁都会走 提交于 2019-12-22 08:26:32
问题 If I have a closed path, I can use Geometry.GetArea() to approximate the area of my shape. This is great and saves me a lot of time. But is there anything around that will help me find the length of a unclosed path? The best I've been able to come up with for now is to make sure I am using PathGeometry and call the GetPointAtFractionLength method multiple times, get the points and add up the distance between all those points. Code: public double LengthOfPathGeometry(PathGeometry path, double

Getting actual path of PathGeometry

与世无争的帅哥 提交于 2019-12-11 07:07:33
问题 Is there a way to get the actual path of a PathGeometry in WPF? I've looked at RenderedGeometry , but it doesn't appear to provide anything other than what I put in. For example, here's my XAML: <Path x:Name="right" Canvas.Left="10" Canvas.Top="10" StrokeThickness="3" Stroke="Black" StrokeEndLineCap="Round" StrokeStartLineCap="Round" StrokeLineJoin="Miter" Data="M0,9L4.5,0L9,9 "/>` This produces: Does WPF provide any function natively or is there way to get the traced outline of this shape in

Convert XAML PathGeometry to WPF PathGeometry

本秂侑毒 提交于 2019-12-09 19:12:31
问题 I want the PathGeometry that consist of LineSegment. So, I use this first code but it's error. PathGeometry temp = (PathGeometry)Geometry.Parse( "<PathGeometry.Figures>" + "<PathFigure StartPoint=\"193.5,283.5\" IsClosed=\"True\">" + "<PathFigure.Segments>" + "<LineSegment Point=\"418.5,283.5\" />" + "<LineSegment Point=\"418.5,508.5\" />" + "<LineSegment Point=\"193.5,508.5\" />" + "<LineSegment Point=\"193.5,283.5\" />" + "</PathFigure.Segments>" + "</PathFigure>" + "</PathGeometry.Figures>

weird issue when drawing a forth and back path in wpf

萝らか妹 提交于 2019-12-08 12:18:51
问题 I was drawing a series of points with Path in c# code. I just give an example in xaml. So the polyline is from (20,37) to (20,36) and returns to (20,37). It is supposed to be very short, right? But it turns to be a segment roughly 9dp long. if I simply draw from (20,37) to (20,36), it behaves normal. Because the points are drawn in real-time that I cannot do preprocessing. Why is that and how to solve it? <Path Stroke="Black" StrokeThickness="2"> <Path.Data> <PathGeometry> <PathFigure

Creating an abitrary, curved Well Known Text LineString for display in OpenLayers

谁都会走 提交于 2019-12-08 02:53:32
问题 I am dynamically generating a WKT LineString between points in a map layer being generated for display in OpenLayers. I'd like to make the lines between the points curved, and I'd like to be able to dynamically change the curvature based on various input variables. This is for a network monitoring app, and we'd like the curvature to based on delay times between the points (not the raw delay itself, but the deviation from "normal" values during a given time period). While some GIS app and