Polygon Triangulation with Holes

To give you some more choices of libraries out there: Polyboolean. I never tried this one, but it looks promising: http://www.complex-a5.ru/polyboolean/index.html General Polygon Clipper. This one works very well in practice and does triangulation as well as clipping and holes holes: http://www.cs.man.ac.uk/~toby/alan/software/ My personal recommendation: Use the tesselation from the GLU (OpenGL Utility Library). The … Read more

How to draw arc with radius and start and stop angle

Providing a custom component turned out to be the best solution. I use it like this in my code <Controls:Arc Center=”{Binding Path=PreviousMousePositionPixels}” Stroke=”White” StrokeDashArray=”4 4″ SnapsToDevicePixels=”True” StartAngle=”0″ EndAngle=”{Binding Path=DeltaAngle}” SmallAngle=”True” Radius=”40″ /> SmallAngle when true will render the small angle between the points irrespective of order of StartAngle and EndAngle. When SmallAngle is false the … Read more

Plotting a 3d cube, a sphere and a vector

It is a little complicated, but you can draw all the objects by the following code: from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np from itertools import product, combinations fig = plt.figure() ax = fig.gca(projection=’3d’) ax.set_aspect(“equal”) # draw cube r = [-1, 1] for s, e in combinations(np.array(list(product(r, r, r))), 2): … Read more

is it possible to make SVG circle fill color from bottom to top based on percentage? [duplicate]

you could use a gradient with stop-opacity to do this. you would add two “middle” stops with opacity 0 and 1 respectively an set the offset of both to the percentage you need. <svg xmlns=”http://www.w3.org/2000/svg” viewBox=”0 0 100 100″ width=”200″ height=”200″> <linearGradient id=”lg” x1=”0.5″ y1=”1″ x2=”0.5″ y2=”0″> <stop offset=”0%” stop-opacity=”1″ stop-color=”royalblue”/> <stop offset=”40%” stop-opacity=”1″ stop-color=”royalblue”/> … Read more