Questions tagged [polygon]
The polygon tag has no usage guidance.
57 questions
1
vote
0
answers
27
views
Algorithm for real-time rendering of complex 2D polygons under dynamic transforms on GPU
I would like to know what the state-of-the-art approach is for rendering complex (as in non-simple) 2D polygons on the GPU.
My exact use case is a GeoJSON renderer that is supposed to be able to ...
1
vote
1
answer
215
views
Nomenclature: Other word for non-closed polygon?
In Wikipedia, a polygon is defined as a closed polygonal chain. In other words, the term "polygon" implies that the curve is closed.
My question is: Is it common to refer to non-closed, ...
0
votes
0
answers
44
views
AMD GPU specific triangles disappearing by subsequent draw calls in same frame
we have a Windows/DirectX11 2D Renderer that paints textured triangles to the screen from back to front. There is no face-culling or depth test activated.
Now on AMD GPUs it happens randomly that an ...
0
votes
0
answers
73
views
How would you represent a mesh with tris and quads?
My understanding is that, while subdivision algorithms like Catmull-Clark can work for any polygonal mesh (including triangles) it's preferable to start with a quad mesh.
Currently my rendering engine ...
1
vote
2
answers
135
views
Given two non-intersecting polygons, how to determine which one is in front
I have two 3D polygons, and in both of them all vertices are coplanar. I set a viewing direction and transform the polygons into the coordinate system of the viewing direction, such that the x, y ...
3
votes
0
answers
199
views
Generate polygons after marching squares in parallel
I've implemented the marching squares algorithm following Wikipedia's https://en.wikipedia.org/wiki/Marching_squares. The output I got is a set of edges, to which each contouring cell contributes 0, 1,...
1
vote
0
answers
40
views
How to get a polyline from an image with consistent winding number
I am trying to find an algorithm for the following problem.
Assume we have a black and white image. The image contains a white region that encloses a space. This space may be concave but it has no ...
1
vote
1
answer
364
views
Back face detection
Suppose I have one convex polyhedron, I need to detect back face. And $N=(A, B, C)$ is normal vector of polygon surface and vector $V$ in viewing direction. According to books formula and internet ...
2
votes
1
answer
290
views
Painter's algorithm test 2 and test 3?
TEST #2:
Surface S is completely behind the
overlapping surface relative to the viewing
position.
S1 is completely behind/inside the overlapping surface S2
How to check these conditions?
i) Set the ...
0
votes
1
answer
131
views
HalfEdge: How to get list of all faces from one face
I need to, starting from one face, iterate over the rest of the faces until I reach the first facet. For this I can use twin, start, end or other info of halfedges, faces, vertex. That is, I need to ...
0
votes
2
answers
1k
views
How to calculate vertex normals on a mesh with non-planar polygons
If I have a mesh consisting of polygons that are not necessarily triangles and not necessarily planar. As answered in the previous question I asked, there's no correct answer to calculating normals ...
1
vote
1
answer
125
views
Why do 3d modeling packages use a single normal per polygon and how is this viable for smooth shading
If we have a quad that is non-planar. Why do most 3d modeling packages choose to use a single normal for the quad (Specifically for Blender3d by using cross product of two edge's vectors that do not ...
2
votes
0
answers
55
views
Divide mesh according to level of detail
Background
I need to remesh by OpenVDB, like what Blender remesh does:
Voxel
Uses an OpenVDB to generate a new manifold mesh from the current geometry while trying to preserve the mesh’s original ...
0
votes
1
answer
47
views
Differential or intersection of islands of 2D polygons in different layers
I have a 2D layer/section containing the 2D polygons colored in shades of green.
I have another layer containing the 2D polygons colored in shades of blue.
I intend to figure out how different are ...
0
votes
1
answer
323
views
OpenGL Polygon Offset Fill implementation example code
I am working on a pure java implementation of OpenGL 1 called jGL.
I am missing glPolygonOffsetFill and am looking for an example implementation in java, c/c++ example of this GL function in order to ...
1
vote
1
answer
6k
views
Drawing a square using glDrawArrays with GL_TRIANGLES
I used a version of the following code to draw a triangle using glDrawArrays with GL_TRIANGLES, per Anton Gerdelan's very nice tutorial here:
Hello Triangle !
It draws a nice triangle.
I have modified ...
1
vote
0
answers
54
views
The ploygon width parallel to the x axis as a function of the y ordonate?
Considering a polygon with n vertices as input.
I need to calculate the integral of the form
\[\int_A p(y) dA \] where $p(y)$ is a piecewise polynomial function of $y$.
May be if I could find the ...
3
votes
1
answer
150
views
How to compute the following integral over a polygon?
I am implementing an algorithm which requires me to compute the following integral,
$$\int_{Poly(P_i)}||P-P_i||^2 dP$$
where $P_i=(X_i, Y_i)$ is a point in 2D and $Poly(P_i)$ is a polygon containing $...
1
vote
0
answers
170
views
How to do a scanline fill with a self intersecting polygon?
I have a bezier curve and would like to draw it's stroke. To do that, I planned to approximate the stroke to a polygon and fill it with a scanline algorithm. While I feel confident about implementing ...
0
votes
0
answers
19
views
Turning layered curves to polygon mesh?
I am confronted with the problem to render 3D representations for objects marked on microscope slices.
So I have a set of aligned polygons in parallel planes from tracing the outline of the object in ...
1
vote
0
answers
65
views
Convert a polygon mesh to a bspline surface
Problem:
Getting a polygon mesh as input, I have to construct a surface that looks exactly to the given input. My task is to generate a b-spline surface that exactly looks like the connected polygon ...
1
vote
2
answers
213
views
Convert triangulated object to a polygonized object
Is there an efficient algorithm to convert a 3D object described with a set of triangles to a 3D object described with a set of polygons. Polygons can have an arbitrary number of points, more is ...
0
votes
0
answers
47
views
Cover a polygon with least amount of parallelograms
I am solving the task that is as follows:
Input: a polygon. Can be any kind of polygon without self intersections. Can be a non-convex and with holes inside.
Goal: to cover it with 2 (at least) or ...
2
votes
4
answers
190
views
3D object to slices like in medical scan
I am novice lacking professional terminology.
I want to create from 3D object (let's say from polygon mesh) a slice through to PNG file in order to create something like reverse medical MRI scan from ...
0
votes
3
answers
441
views
An algorithms for covering a 2d polygon with a predetermined number of rectangles?
I am looking for an algorithm that is able to cover with non-overlapping rectangles in a pre-defined number and minimum area a generic 2d-polygon.
Polygons are usually free-hand draws, so they can be ...
5
votes
1
answer
837
views
Why do polygons have to be "simple" and "convex"?
I'm new to computer graphics and just wanted a solid understanding of why?
Why is it so important that polygons you push through the pipeline be "simple" and "convex"?
1
vote
0
answers
338
views
How can I convert a shape made out of pixels to vertices
I'm trying to implement the solution to get the minimum dissection into rectangles of a rectilinear polygon.
My shape is made out of pseudo-pixels (different width/height) but for the moment let's ...
1
vote
1
answer
309
views
Projection of a Polyhedron on xy Plane with CGAL
I am trying to project a Polyhedron on the xy plane with CGAL, which should result in a (2D) polygon.
I wonder, if there is an elegant way to achieve it?
Of course, I can iterate over all surfaces ...
0
votes
1
answer
277
views
Topology: Polygonal Meshes, Euler's Formula
Firstly, I would like to tell this is my first question on stackexchange and I am a senior school student. Please bear with me, if I am not able to express myself clearly.
I am trying to solve a ...
3
votes
1
answer
951
views
Rounding a corner formed by Arc and Line
Given shapes like these, which contain just Arcs and lines, I want to round all its corners with certain radius. I know the vertices of the lines & arcs these shapes.
I can round the corners of a ...
2
votes
3
answers
685
views
Clipping circle and polygon and generate a CAD drawing
I'm developing a CAD drawing generator using C# and netdxf library (https://github.com/haplokuon/netDxf)
The app first performs boolean operations (specifically - union & subtraction) on polygons ...
0
votes
1
answer
291
views
Finding vertices of the outer contour of intersecting polygons
I have a bunch of intersecting convex polygons, I want to find vertices of the outer contour of all those polygons. An individual polygon is not self-intersecting.
Could you please tell What could be ...
5
votes
3
answers
2k
views
Rounding corners of polygon given vertices of its corners
Given a polygon (regular or irregular, convex or concave), I want to round its corner, with a given radius; let's say 'x'. I have the code to draw an arc given 2 points, but how can I find the start ...
4
votes
1
answer
141
views
Vertices of a regular polygon given the incircle radius
How can I find the vertices of a polygon (specifically hexagon) given the radius of the incircle? I want to calculate the vertices of a polygon given the face-to-face distance (inscribed circle ...
9
votes
1
answer
255
views
How can I check if a polygon can completely contain a circle of a certain radius?
How can I check if a polygon (can also be irregular) can completely contain a circle of a certain radius? I do not want to actually draw a circle inside the polygon but just a boolean outcome whether ...
1
vote
1
answer
513
views
Fill an irregular region with 2D shapes
I am creating a 2D CAD drawing generator in C# using .netDXF library. Given a area I want to fill it with rectangles/circles (convex). For example, the regions marked with numbers in below image. This ...
2
votes
0
answers
1k
views
Scan Line Polygon Fill Edge Table Entry Order
I am trying to figure out the correct order between edges on edge table on scan line polygon fill.
One example here on Y=1 takes first ...
4
votes
1
answer
340
views
Polygons versus curve primitives in software rendering
Most 3D video games since the nineties have used hardware rendering based on polygons. Why polygons? They work well for some things, but not so well for others, e.g. a human figure rendered in ...
-2
votes
1
answer
60
views
constrain based dynamic geometry generation [closed]
I have a bounding box of 1000m x 1000m. I randomly generate 10000 points (sites) inside it. Now, how can I create 'n' polygons (geometries) within the bounding box based on a given constrain.
The ...
6
votes
1
answer
404
views
List of triangles to minimum amount of convex polygons
I'm in search for an algorithm that takes the left side of the following graphic as an input and outputs a minimal amount of convex polygons as seen on the right side of the graphic.
The input mesh ...
3
votes
2
answers
534
views
An algorithm to find the area of intersection between a convex polygon and a 3D polyhedron?
Suppose I have a set of points in 3D which are all co-planar, and which describe the vertices of a convex polygon. I know the coordinates of all of these vertices, I know the unit normal to the plane ...
3
votes
1
answer
172
views
Remove clearly not visible vertices from a polygon
For a visibility algorithm I want to remove verts of polygon that are guaranteed not visible from a vert S. The idea is to remove pockets that points are on the backside of a plane formed by the ...
3
votes
3
answers
3k
views
How to understand Z-Fighting?
I searched for Z Buffer on Google and I discovered that's a 2 dimensional array used by the graphical card and whose aim is to enable the handling of two pixels' depth in order to display one of these ...
3
votes
0
answers
89
views
What is a good algorithm, and framework, to calculate centres of gravity or mass (cog)?
I'd like to take an photograph, subdivide it into a tesselation, either of squares, or (ideally), hexagons, and then find the centre of gravity (or, if you prefer, centre of mass) of each cell of the ...
5
votes
1
answer
170
views
Where should I project a polygon corner when it is behind me?
I am creating a simple 3D engine as a learning project to get the hang on spherical trigonometry. I am using the following approach.
1. A model consists of a lot of triangular faces.
2. Each triangle ...
0
votes
0
answers
99
views
In a polygonal mesh 3d model which consist of triangles is it possible to separate different objects?
I have a 3d city model that is a collada file which consist of many triangles. When I select the model in a 3d software all buildings are selected. But I want every building to be selectable ...
3
votes
1
answer
345
views
Maximal and minimal no. of angles obtained from clipping a convex polygon with n angles
I'm trying to figure this out for my Computer Graphics course, but I find it very hard to understand.
I believe the minimum number of angles obtained from clipping a convex polygon with n angles is ...
7
votes
2
answers
2k
views
Converting cartesian pixels to polar pixels
(I've largely revamped this entire question, though the motivation remains the same.)
revised question
I want to convert a raster of cartesian pixels into polar pixels. Is there a sensible ...
6
votes
3
answers
4k
views
Explanation of the Vatti clipping algorithm
I am going through the Vatti Arbitrary Polygon Clipping Algorithm, but got stuck at their very initial explanation. It says the following:
Call an edge of a polygon a left or right edge if the ...
3
votes
1
answer
105
views
Finding the maximum number of disconnected fragments
In a plane, we have a convex polygon with n sides. What would be the maximum number of disconnected pieces / fragments if this polygon is clipped against a square?