computational-geometry

Find rectangles that contain point – Efficient Algorithm

浪尽此生 提交于 2019-12-18 13:19:29
问题 Good afternoon. My situation: In two-dimensional space . Input : a set of rectangles ( overlapping rectangles too). Rectangles coordinates are integer type . There are not any constraints on rectangle-size and rectangle-location (only extent of integer). No rectangles have width=0 or height=0. I need to find : all rectangles that contain entered point (with integer coordinates). Questions: What is the efficient structure to keep rectangles? What alghorithm is efficient in this case? And what

What's a good library to do computational geometry (like CGAL) in a garbage-collected language?

こ雲淡風輕ζ 提交于 2019-12-18 12:59:12
问题 I need a library to handle computational geometry in a project, especially boolean operations, but just about every feature is useful. The best library I can find for this is CGAL, but this is the sort of project I would hesitate to make without garbage collection. What language/library pairs can you recommend? So far my best bet is importing CGAL into D. There is also a project for making Python bindings for CGAL, but it's very incomplete. 回答1: I would still recommend to proceed with Python

Is there some well-known algorithm which turns user's drawings into smoothed shapes?

拈花ヽ惹草 提交于 2019-12-18 12:24:05
问题 My requirements: A user should be able to draw something by hand. Then after he takes off his pen (or finger) an algorithm smooths and transforms it into some basic shapes. To get started I want to transform a drawing into a rectangle which resembles the original as much as possible. (Naturally this won't work if the user intentionally draws something else.) Right now I'm calculating an average x and y position, and I'm distinguishing between horizontal and vertical lines. But it's not yet a

Efficient Line Smoothing and/or Simplification

此生再无相见时 提交于 2019-12-18 11:08:35
问题 I am creating a painting application in Actionscript (although my question is not Actionscript related). The basic idea is to start painting when the mouse is pressed and tracking the mouse movements. What I want to achieve is: reduce mouse "noise" and create more smoother looking lines. Right now, ( 1 ) is problematic because I get thousands of mouse movements within a few seconds. Due to ( 1 ) the line can look jaggy. What current idea: when the user finishes drawing the line, I store all

Java: plot points based on distances

梦想与她 提交于 2019-12-18 07:24:45
问题 I need to plot a group of points based on distances. I have three unknown points X, Y, and Z. I then get another unknown point (A) and its distances from the originals (AX, AY, AZ). I will continue getting points and distances (B, BX, BY, BZ; C, CX, CY, CZ) etc. My question is whether its possible to plot all of the points. If so, how many points would I need for an exact plot map? What about an approximate map? This is similar to this question but I get a different set of distances and am

Boolean Operations on SVG paths [closed]

半世苍凉 提交于 2019-12-18 03:58:18
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . As of early 2014, SVG spec does not have any built-in support for Boolean Operations Boolean operations are methods for altering the inherent geometry of mostly overlapping paths. They allow the construction of complicated shapes by performing operations on simpler shapes and are somehow similar to Constructive

Draw a parallel line

情到浓时终转凉″ 提交于 2019-12-17 22:34:21
问题 I have x1,y1 and x2,y2 which forms a line segment. How can I get another line x3,y3 - x4,y4 which is parallel to the first line as in the picture. I can simply add n to x1 and x2 to get a parallel line but it is not what i wanted. I want the lines to be as parallel in the picture. 回答1: What you want to do is to offset the coordinates in the orthogonal direction. If you know vector math, multiply the vector created by the distance between the endpoints of the line by the following matrix: [ 0

How do I derive a Voronoi diagram given its point set and its Delaunay triangulation?

笑着哭i 提交于 2019-12-17 22:16:59
问题 I'm working on a game where I create a random map of provinces (a la Risk or Diplomacy). To create that map, I'm first generating a series of semi-random points, then figuring the Delaunay triangulations of those points. With that done, I am now looking to create a Voronoi diagram of the points to serve as a starting point for the province borders. My data at this point (no pun intended) consists of the original series of points and a collection of the Delaunay triangles. I've seen a number

How to calculate inverse kinematics [closed]

六月ゝ 毕业季﹏ 提交于 2019-12-17 22:05:15
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . I want to know how to calculate rotation angles using inverse kinematics. I am planning on using this for real time 3d animation. Anyone know of some good literature that details a specific solution? 回答1: The following resources survey some popular numerical methods for inverse kinematics problems: Samuel R.

How to find polygons in a given set of points and edges?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-17 21:08:17
问题 Consider the following problem: Given N points in plane and M line segments connecting them, find all polygons (convex or concave) that do not contain any other polygons inside. For instance: There are 5 polygons founded: 1 - 2 - 5 - 6 2 - 3 - 5 3 - 4 - 5 7 - 8 - 9 10 - 13 - 20 - 12 - 11 How can I identify these polygons and there corresponding vertices and edges? And what is the fastest solution for this? 回答1: Build graph with segment ends as vertices and segments as edges, then find cycles