computational-geometry

Algorithm “NoObtuse” in javascript

梦想与她 提交于 2019-12-12 04:54:43
问题 Algorithm "NoObtuse" in javascript. I have to implement this algo below in a canvas. The user put a set of points and click on the button to call the function "noObtuse" and I have to draw the graph (see image). How can I do it ? No obtuse algoritm EDIT: I change the code with the informations of "MBo" but I don't get what I need, the nextPoint is not the right one (Neither in CW nor in CCW). My code: class Point { constructor(x, y) { this.x = x; this.y = y; this.col = 'red'; } drawDot() {

Edge Collapse with assimp

ぃ、小莉子 提交于 2019-12-12 04:31:56
问题 I'm trying to implement the edge collapse in my game engine, there is a problem caused by Assimp. The indices that parsed from face.mNumIndices is always the increment order indexing. When I check the list of indices, the value should be sort of 0,1,2,3,4....,999... . But I know this is some kind of mechanism that used by Assimp, and the object are rendered all right. But there is another issue on Mesh Simplication, I could not generate the half-edge structure for this indices. I stuck on

Distribute circles around a center circle

China☆狼群 提交于 2019-12-12 02:15:52
问题 I'm trying to place six circles around a center circle. Eeach of them has the same diameter so it should be possible to place them around the center without space between or overlaps. I thinking to be close to the solution but there are small overlaps. I can't find an answer how to get a perfect calculation. Thats my current result: and this the way how I've calculated it: this.distribute = function () { var surfaceSize = this.surface.getAbsoluteSize(), i, x = 0, y = 0; // 7 CIRCLES 6

Implementing Bentley–Ottmann Algorithm with an AVL tree

心已入冬 提交于 2019-12-11 20:34:47
问题 I'm having a problem implementing this method in java. I'm specifically implementing the algorithm FINDINTERSECTIONS in Computational Geometry 3rd Edition using an AVL BST tree for the status. The description from the book is shown below: The problem I'm having is implementing step 5 in HANDLEEVENTPOINT . When the event point is an intersection, the status is no longer totally ordered there, because for intersection lines, they cross at their intersection point and need to be swapped in the

How to find custom shape speicific area?

*爱你&永不变心* 提交于 2019-12-11 19:45:18
问题 please , see following image, here you can see blue rectangle is custom shape bounds and custom shape is shoe , i want to find area of a portion written in image and i want that area in form of rectangle do is there any path iterator concept ? Note custom shape i derived from image of the same size. 回答1: I would do it like this: 1.create table for all bounding box-rect perimeter lines each value in it will represent the empty space length form border line to shape something like this: the

How to get the vertices and the faces of a polygon mesh with CGAL?

一世执手 提交于 2019-12-11 14:18:24
问题 With CGAL , I'm able to get a polyhedron mesh in OFF format. For example the program below builds two tetrahedra, computes their intersection, and returns the result in an OFF file. The OFF output provides the vertices coordinates and the faces given by the vertices indices. But I would like to get the vertices and the faces as C++ variables (for example double vectors for the vertices and int vectors for the faces). Is it possible, and how? Of course I could extract what I want from the OFF

Finding the polygon in a 2D mesh which contains a point

戏子无情 提交于 2019-12-11 12:17:29
问题 I have a 3D polygon mesh and a corresponding 2D polygon mesh (actually from a UV map) which I'm using to map the geometry onto a 2D plane. Given a point on the plane, how can I efficiently find the polygon on which it's resting in order to map that 2D point back into 3D? The best approach I can think of is to store the polygons in a 2D interval tree, and use that to get candidate polygons. Is there a simpler approach? To clarify, this is not for a shader. I'm actually taking a 2D physical

Fitting a rectangle inbetween existing, non-overlapping rectangles

谁说胖子不能爱 提交于 2019-12-11 11:58:36
问题 I have a problem that can perhaps best be illustrated with windows on a computer screen: create another window, as large as possible, not overlapping any of the existing windows. In other words: given a set of N rectangles on a finite surface (a sheet of paper, or a screen), find the largest rectangle that can be fitted inbetween these rectangles. (Coordinates can be arbitrary, so a bitmap is not a viable solution here.) The following photo shows three rectangles (in black) and the largest

Rectangles Intersection (Vertical line)

若如初见. 提交于 2019-12-11 08:06:37
问题 For a given rectangle R1 I am trying to find out which are the other rectangles that could intersect with it IF I draw a vectical line segment. The rectangles that intersect with R1 are marked in Red. Every rectangle is characterized by its (top, left) and (bottom, right) coordinates. R1 = [top, left, bottom, right],...,Rn = [top, left, bottom, right] By using the coordinates and the vertical line. I want to find the rectangles that intersects with R1 Solution I found the following library

Distance between two lat/long points in Classic ASP

♀尐吖头ヾ 提交于 2019-12-11 05:34:12
问题 I have two pairs of latitude/longitude, and want to find the distance between them. I am stuck with using Classic ASP on this particular website. I found plenty of code examples using the Haversine equation, but not in ASP (which lacks the ACos function, and doesn't have pi built in! I eventually got some code working, but after careful testing it proved to be flawed. My understanding of spherical geometry isn't good enough, so please can anyone say if they have done this in ASP before?!