computational-geometry

repainting an applet from a swingworker used to compute triangles and circum-circles

对着背影说爱祢 提交于 2019-12-10 21:05:20
问题 I am trying to replicate the applet found here as a part of an exercise. The applet is using Fortune's algorithm to generate both; a Voronoi diagram and Delaunay triangulation. I am just interested in generating the Delaunay Triangulation in a plane and thus, would be using the incremental algorithms i.e. adding 1 point at a time. I intend to show the triangles being generated at every stage when a sample point is added. I am using a SwingWorker class to create an instance of the Triangulate

find (near-)minimal covering set of discs on a 2-D plane

人盡茶涼 提交于 2019-12-10 16:59:13
问题 OK, say I've got a bunch of discs sitting on a plane in fixed known locations. Each disc is 1 unit in radius. The plane is fully covered by the set of discs, in fact, it is extensively over-covered by the set of discs, by an order of magnitude or two in some areas. I'd like to find a subset of the discs that still fully cover the plane. Optimal is nice, but not necessary. Here's the before illustration: And here's the after illustration: It seems to me that there's a dual problem having to do

Packing an irregular polygon with different sized circles

懵懂的女人 提交于 2019-12-10 16:17:04
问题 I'm trying to write a program in Python with Shapely that takes in shape files (right now congressional districts) and "packs" them with circles. The end goal is to have the center points and radii of the circles. I'd like to cover the maximum area with the least amount of circles. All of the resources I've found via Google so far are about circle packing within standard geometric objects like squares/circles/triangles etc... So my instinct is to try and turn these shapes into triangles or

Generating vertex normals for smooth shading with crease angle in Three.js

淺唱寂寞╮ 提交于 2019-12-10 13:46:35
问题 I have several objects in Three.js's JSON Model Format. It specifies vertex positions, and faces -- sometimes triangles, sometimes quads, sometimes with material indices and sometimes not. However none of these files have vertex normals specified. I want an algorithm that can calculate such normals over a set of mesh faces. I'd like to specify an angular limit beyond which a crease is shown (normals are not shared by adjacent faces at a vertex.) Before coding this myself I wondered, does this

CGAL: Intersection between a segment and a polygon?

独自空忆成欢 提交于 2019-12-10 13:27:59
问题 I have a set of polygons and I want to test intersection between it and a segment. I checked the manual but I cannot find a matching function. The intersection between points, lines, segments, triangles, planes do exist. And the intersection between polygons are also there. My question is: Is there such a function? If not, does it mean I need to break down the polygons into segments and do intersection among these segments? (The reason that I am reluctant to do this is, I thought CGAL might

How to find if a 3D object fits in another 3D object (the container)?

给你一囗甜甜゛ 提交于 2019-12-10 12:57:36
问题 Given two 3d objects, how can I find if one fits inside the second (and find the location of the object in the container). The object should be translated and rotated to fit the container - but not modified otherwise. Additional complications: The same situation - but look for the best fit solution, even if it's not a proper match (minimize the volume of the object that doesn't fit in the container) Support for elastic objects - find the best fit while minimizing the "distortion" in the

Finding intersection between sets of points describing a curve

独自空忆成欢 提交于 2019-12-10 12:19:17
问题 Say I have two sets of points p1, p2, p3,... ,pn and q1, q2, q3,..., qn which describe two paths (curves) in a plane. The points may not be evenly sampled from the curve, but they are "in order" (with regard to parameterizations of the curves). What is a good way to find out where these two curves intersect? So for example, I may have just two points each (0,0) (1,0) and (-5,1) (-4,-1) in which case their intersection is (-4.5,0). The most rudimentary way to do this would be to draw the edges

Compose two rotations in D3 geo projection?

我怕爱的太早我们不能终老 提交于 2019-12-10 11:28:29
问题 Having fun with D3 geo orthographic projection to build an interactive globe, based on all the great examples I found. You can see my simple mockup at http://bl.ocks.org/patricksurry/5721459 I want the user to manipulate the globe like a trackball (http://www.opengl.org/wiki/Trackball). I started with one of Mike's examples (http://mbostock.github.io/d3/talk/20111018/azimuthal.html), and improved slightly to use canvas coordinates and express the mouse locations in 'trackball coordinates' (i

Calculate equidistant point with minimal distance from 3 points in N-dimensional space

与世无争的帅哥 提交于 2019-12-10 10:50:57
问题 I'm trying to code the Ritter's bounding sphere algorithm in arbitrary dimensions, and I'm stuck on the part of creating a sphere which would have 3 given points on it's edge, or in other words, a sphere which would be defined by 3 points in N-dimensional space. That sphere's center would be the minimal-distance equidistant point from the (defining) 3 points. I know how to solve it in 2-D (circumcenter of a triangle defined by 3 points), and I've seen some vector calculations for 3D, but I

Iterative Closest Point Implementation

巧了我就是萌 提交于 2019-12-10 04:29:09
问题 I am currently using the following pseudo code to implement the ICP algorithm in C#. Obtained from ICP Powerpoint function ICP(Scene,Model) begin E` = + ∞; (Rot,Trans) = In Initialize-Alignment(Scene,Model); repeat E = E`; Aligned-Scene = Apply-Alignment(Scene,Rot,Trans); Pairs = Return-Closest-Pairs(Aligned-Scene,Model); (Rot,Trans,E`) = Update-Alignment(Scene,Model,Pairs,Rot,Trans); Until |E`- E| < Threshold return (Rot,Trans); end However I am not entirely sure how update alignment should