tesselation

plotting and coloring data on irregular grid

帅比萌擦擦* 提交于 2019-11-30 02:23:14
I have data in the form (x, y, z) where x and y are not on a regular grid. I wish to display a 2D colormap of these data, with intensity (say, grey scale) mapped to the z variable. An obvious solution is to interpolate (see below) on a regular grid, d <- data.frame(x=runif(1e3, 0, 30), y=runif(1e3, 0, 30)) d$z = (d$x - 15)^2 + (d$y - 15)^2 library(akima) d2 <- with(d, interp(x, y, z, xo=seq(0, 30, length = 30), yo=seq(0, 30, length = 50), duplicate="mean")) pal1 <- grey(seq(0,1,leng=500)) with(d2, image(sort(x), sort(y), z, useRaster=TRUE, col = pal1)) points(d$x, d$y, col="white", bg=grey(d$z

Tessellating an arbitrary polygon by tiling triangles

爷,独闯天下 提交于 2019-11-29 13:58:17
问题 I need to fill an arbitrary polygon using a near-uniform tiling of triangles. How would I do this? You may provide either references to existing algorithms or even simply ideas or hints of your own. The following is presumed: The polygon may be convex (but bonus points if you come up with an algorithm that works for concave shapes) The polygon has an arbitrary number of edges (3 or more) The amount of tessellation (preferably the number of vertices added by the algorithm) should be

plotting and coloring data on irregular grid

痴心易碎 提交于 2019-11-28 23:14:22
问题 I have data in the form (x, y, z) where x and y are not on a regular grid. I wish to display a 2D colormap of these data, with intensity (say, grey scale) mapped to the z variable. An obvious solution is to interpolate (see below) on a regular grid, d <- data.frame(x=runif(1e3, 0, 30), y=runif(1e3, 0, 30)) d$z = (d$x - 15)^2 + (d$y - 15)^2 library(akima) d2 <- with(d, interp(x, y, z, xo=seq(0, 30, length = 30), yo=seq(0, 30, length = 50), duplicate="mean")) pal1 <- grey(seq(0,1,leng=500))

I have an OpenGL Tessellated Sphere and I want to cut a cylindrical hole in it

蓝咒 提交于 2019-11-27 02:26:48
I am working on a piece of software which generated a polygon mesh to represent a sphere, and I want to cut a hole through the sphere. This polygon mesh is only an overlay across the surface of the sphere. I have a good idea of how to determine which polygons will intersect my hole, and I can remove them from my collection, but after that point I am getting a little confused. I was wondering if anyone could help me with the high-level concepts? Basically, I envision three situations: 1.) The cylindrical hole does not intersect my sphere. 2.) The cylindrical hole partially goes through my