computational-geometry

Plot VoronoiDiagram using Graphics in Mathematica

◇◆丶佛笑我妖孽 提交于 2019-12-11 05:29:23
问题 Completing questions on how to plot a ConvexHull or a DelaunayTriangulation using Graphics in Mathematica, I would now like to plot the VoronoiDiagram within Graphics. Considering : Needs["ComputationalGeometry`"] pts = RandomReal[{0, 10}, {60, 2}]; vdpts=VoronoiDiagram[pts] 回答1: How about Needs["ComputationalGeometry`"] pts = RandomReal[{0, 10}, {10, 2}] DiagramPlot[pts] or am I missing your point? 来源: https://stackoverflow.com/questions/6477753/plot-voronoidiagram-using-graphics-in

How to programatically process the image to black and white and separate out the polygon

萝らか妹 提交于 2019-12-11 04:54:51
问题 I have an image that represents a polygon. I want to process it in matlab and generate the image below. Basically i am asking to separate the polygon from the rest of the image out. This question got inspired here. 回答1: We only interested in the red pixels we can use the first channel(Red) to extract coordinates centroid of each scaled pixel. Since there may be slight differences between the same coordinates we can use third output of the uniquetol function to convert absolute coordinates to

Drawing an Emergent ellipse with a turtle.

筅森魡賤 提交于 2019-12-11 04:45:02
问题 This is an answer to a question posed in the comments in my possibly poorly worded question about super-ellipses. in Netlogo it is natural to draw geometric shapes in ways that may seem strange in other languages. ask turtle 1 [pendown let d (pi * distance turtle 2) / 360 repeat 360 [face turtle 2 rt 90 fd d] ] for instance inscribes makes turtle 1 draw a circle [360-gon] around turtle 2. I did not invoke any of the standard circle formulas but still get a circle. Is it possible to draw an

Rectangular Nesting - Convergence to optimal solution using Simulated Annealing

你说的曾经没有我的故事 提交于 2019-12-11 03:37:52
问题 I'm using Simulated Annealing for Rectangular Nesting problem. I'm able to get good results, but the solution i got is DISCRETE. Even global optimum is not always obtained. Problem Description: Objective - To minimize the length of the infinite sheet (Width is constant) by changing the order in which parts are placed. Problem i Face: The output Results i get are DISCRETE(only 15 possible utilization %) instead of ANALOG (as there is 11!*2^11 possible solution -> We expect the results to be

Way to group coplanar triangles in THREEJS mesh?

南笙酒味 提交于 2019-12-11 01:45:32
问题 I'm working on a modeling tool that lets you directly manipulate meshes. For instance, you can grab a face and drag it around. The user's perception of the "face" could be of more than one coplanar triangle. For instance, the top "face" of a cube would actually be two triangles that get dragged together as one square. To accomplish this, I'd like to collect all coplanar, adjacent faces to any particular triangle for use when dragging. I've looked at Simplifier, as well as this post as

What is the ε (epsilon) parameter in Locality Sensitive Hashing (LSH)?

好久不见. 提交于 2019-12-11 01:37:10
问题 I've read the original paper about Locality Sensitive Hashing. The complexity is in function of the parameter ε, but I don't understand what it is. Can you explain its meaning please? 回答1: ε is the approximation parameter . LSH (as FLANN & kd-GeRaF) is designed for high dimensional data. In that space, k-NN doesn't work well, in fact it is almost as slow as brute force, because of the curse of dimensionality. For that reason, we focus on solving the aproximate k-NN. Check Definition 1 from

Difference between vertex and point in vtk

筅森魡賤 提交于 2019-12-11 01:17:54
问题 What's the main difference between a vertex and a point in VTK? Well, I was assigning some computed points to an vtkPolyData output: vtkPolyData* oput = vtkPolyData::SafeDownCast(out_info->Get(vtkDataObject::DATA_OBJECT())); and I wondered whether to use the method SetVerts(vtkCellArray *v) or the method SetPoints(vtkPoints *) . 回答1: In VTK datasets (i.e., classes inheriting vtkDataSet which is the simplest type of data that provides a notion of points), points are simply locations in space.

Detect group of points further to the rest

谁都会走 提交于 2019-12-11 00:34:58
问题 I have a set of points from a laser recognition of a sewer. This sewer has a hole in it. The main goal is to detect this hole and decide whether it's clean or not. One way to detect it is to find the hole and see if it is a circle (in which case it is clean) or a circle with the upper or bottom side straight (in which case it is dirty). There may be several solutions to obtain my main goal. I think that detecting this set of points that generate the hole and projecting them could be a good

The Algorithm to Overlay of Two Mesh Systems

戏子无情 提交于 2019-12-10 23:17:16
问题 I have two systems of mesh, which are consist of Delaunay Triangulation. One can view this as a Triangulated Irregular Network (TIN). The algorithm I can think of for adding or subtracting two TINs ( t1 and t2 ) can be summarized as follows: Find the overlay ( or clip) of two TINs For each point in the overlay, find the z1 and z2 resulted from the two TINs. Develop a Delaunay Triangulation for all the points in the overlay, and then use the z1 and z2 information above, one can thus create a

Compute intersection area of two polygons with cgal

半腔热情 提交于 2019-12-10 21:35:29
问题 Given the vertices of two convex polygons, what is the simplest way of computing the area of their intersection using cgal? 回答1: Because you are working with convex polygons, there is no need to worry about holes. So the simplest code that I can think of is basically construct the polygons, call intersection, loop over intersection and total up the area:: #include <iostream> #include <CGAL/Simple_cartesian.h> #include <CGAL/Polygon_2.h> #include <CGAL/Polygon_with_holes_2.h> #include <CGAL