pathgeometry

Path stroke algorithm (convert to triangles/quads) or other suggestions

有些话、适合烂在心里 提交于 2019-12-07 01:34:28
问题 Does anyone know a good algorithm for converting a vector path into a stroked path that is composed of triangle/quad faces? Ideally with round line joins. Basically I am trying to draw a thick path that whose colour is based upon a value that varies with the distance along the path. I'm thinking that converting the path to triangles/quads and texture mapping it by providing the distance along the path as a 1d texture coordinate that can then be used to retrieve the colours at the corners of

Is there a more efficient way to detect polygon overlap/intersection than PathGeometry.FillContainsWithDetail()?

给你一囗甜甜゛ 提交于 2019-12-06 02:23:30
问题 I have a method that is gobbling up 25% of my cpu time. I call this method about 27,000 times per second. (Yup, lots of calls since it's updating frequently). I am wondering if anybody knows a faster way to detect if 2 polygons overlap. Basically, I have to check the moving objects on the screen against stationary objects on the screen. I am using PathGeometry and the two calls below are using up 25% of the cpu time used by my program. The PointCollection objects I am passing just contain 4

How do you clone a path resource in Silverlight?

拈花ヽ惹草 提交于 2019-12-05 05:19:15
问题 I have a resource defined in my Xaml file as follows: <Path x:Key="myPath" Data="M14.773241,18.080208 C12.373256,18.080208 10.239936,19.30687 10.239936,27.573483 L10.239936,36.106766 C10.239936,45.440037 12.586588,46.506699 14.986573,46.506699 C18.613216,46.506699 19.359879,42.400059 19.359879,35.3601 L19.359879,27.733482 C19.359879,20.05353 17.386559,18.080208 14.773241,18.080208 z M14.879907,11.786915 C17.973221,11.786915 22.293194,13.013573 24.906511,17.920212 C26.773167,21.386856 27

Path stroke algorithm (convert to triangles/quads) or other suggestions

試著忘記壹切 提交于 2019-12-05 04:47:23
Does anyone know a good algorithm for converting a vector path into a stroked path that is composed of triangle/quad faces? Ideally with round line joins. Basically I am trying to draw a thick path that whose colour is based upon a value that varies with the distance along the path. I'm thinking that converting the path to triangles/quads and texture mapping it by providing the distance along the path as a 1d texture coordinate that can then be used to retrieve the colours at the corners of the triangles and interpolate. Any other suggestions on how to do this that won't look terrible and can

Convert XAML PathGeometry to WPF PathGeometry

我们两清 提交于 2019-12-04 12:31:52
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>"); If I use this second code, it's not error but it doesn't consist of LineSegment. The result will be

Is there a more efficient way to detect polygon overlap/intersection than PathGeometry.FillContainsWithDetail()?

不羁的心 提交于 2019-12-04 06:59:38
I have a method that is gobbling up 25% of my cpu time. I call this method about 27,000 times per second. (Yup, lots of calls since it's updating frequently). I am wondering if anybody knows a faster way to detect if 2 polygons overlap. Basically, I have to check the moving objects on the screen against stationary objects on the screen. I am using PathGeometry and the two calls below are using up 25% of the cpu time used by my program. The PointCollection objects I am passing just contain 4 points representing 4 corners of a polygon. They may not create a rectangular area, but all the points

How do you clone a path resource in Silverlight?

我与影子孤独终老i 提交于 2019-12-03 21:05:57
I have a resource defined in my Xaml file as follows: <Path x:Key="myPath" Data="M14.773241,18.080208 C12.373256,18.080208 10.239936,19.30687 10.239936,27.573483 L10.239936,36.106766 C10.239936,45.440037 12.586588,46.506699 14.986573,46.506699 C18.613216,46.506699 19.359879,42.400059 19.359879,35.3601 L19.359879,27.733482 C19.359879,20.05353 17.386559,18.080208 14.773241,18.080208 z M14.879907,11.786915 C17.973221,11.786915 22.293194,13.013573 24.906511,17.920212 C26.773167,21.386856 27.519829,27.093487 27.519829,32.213455 C27.519829,34.506775 27.306496,41.706726 24.906511,46.453365 C23.626518

Get path geometry from image

 ̄綄美尐妖づ 提交于 2019-12-03 05:41:36
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 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 opensource, and while it's intended primarily for editing SVG vector-based images, it has two key features that

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

北城以北 提交于 2019-12-03 03:46:44
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 to some place where I can find good algorithm to do similar thing? Edit: I haven't found anything

Extract numbers from String

时光总嘲笑我的痴心妄想 提交于 2019-12-02 07:16:31
问题 I have to parse a String to create a PathSegmentCollection. The string is composed of numbers separated by comas and/or (any) whitespaces (like newline, tab, etc...), also the numbers can be written using scientific notation. This is an example: "9.63074,9.63074 -5.55708e-006 0 ,0 1477.78" And the points are: P1(9.63074, 9.63074), P2(-0,555708, 0), P3(0, 1477.78) To extract numbers I use a regular expression: Dim RgxDouble As New Regex("[+-]?\b[0-9]+(\.[0-9]+)?(e[+-]?[0-9]+)?\b") Dim Matches