Questions tagged [space-filling-curve]
24 questions
9
votes
2 answers
Plotly 3D filling under the line
I would like to plot a 3D-Line Plot with Plotly for time-series and fill under the every line. I have an example code here.
library(plotly)
dens <- with(diamonds, tapply(price, INDEX = cut, density))
data <- data.frame(
x = unlist(lapply(dens,…

plotly_user
- 111
- 1
- 4
6
votes
1 answer
Is Morton code the most efficient for higher dimensions?
For my current input data, which is points in 3D, I'm using Morton code to improve the cache coherence when accessing the point list.
I have some other data that is 6D and 7D. Is Morton code still a good technique for such dimensions? Or are there…

Ashwin Nanjappa
- 76,204
- 83
- 211
- 292
3
votes
1 answer
Generating a 3D space filling Hilbert curve using turtle graphics
I have a turtle-graphics-based algorithm for generating a space-filling Hilbert curve in two dimensions. It is recursive and goes like this:
Wa want to draw a curve of order n, in direction x (where x ∈ {L, R}), and let y be the direction opposite…

user4520
- 3,401
- 1
- 27
- 50
3
votes
2 answers
What is a fast n-dimensional Z-order curve algorithm?
Space filling curves are a way to fill a grid with line that preserves locality - that is, two close points at the line are also 2 close points on space.
Is there any fast (O(1)) algorithm to map between an N-dimensional coordinate and the index on…

MaiaVictor
- 51,090
- 44
- 144
- 286
2
votes
1 answer
How to calculate the hilbert index from double coordinates?
I would like to transform a coordinate pair represented by two double values (x, y) into a Hilbert value. I have found the following implementation (from this link):
/*****************************************************************
* hilbert_c2i
…

Anderson Carniel
- 1,711
- 2
- 16
- 22
2
votes
3 answers
Hilbert-Peano curve to scan image of arbitrary size
I have written an implementation of Hilbert-Peano space filling curve in Python (from a Matlab one) to flatten my 2D image:
def hilbert_peano(n):
if n<=0:
x=0
y=0
else:
[x0, y0] = hilbert_peano(n-1)
x =…

floflo29
- 2,261
- 2
- 22
- 45
2
votes
1 answer
CUDA / OpenCL cache coherence, locality and space-filling curves
I'm working on a CUDA app that makes use of all available RAM on the card, and am trying to figure out different ways to reduce cache misses.
The problem domain consists of a large 2- or 3-D grid, depending on the type of problem being solved. (For…

3Dave
- 28,657
- 18
- 88
- 151
1
vote
0 answers
Space filling curve for nodes ordering
I'm trying to convert a set of nodes of a mesh into a space-filling curves.
Now, I tried both Morton encoding and Hilbert curve, and the Hilber curve was the one which worked best. But I have the following problem:
It could happen that two nodes…

Cla
- 171
- 1
- 12
1
vote
0 answers
Interleave float coordinates without error
I wonder how I can interleave float coordinates. This website describes how to do the interleaving part, but it is only for integers.
I have tried following method:
lat = 5.01, lng = 6.01
newLat = (5.01+90) * 100
newLng = (6.01+180) * 100
But it…
user12067722
1
vote
0 answers
Calculating Hilbert Curve by iteration for a Coordinated List (COO) Sparse Matrix
I am working on the PageRank problem and have a Coordinated list (Coo) matrix. The matrix has a source and destination array as seen below. Every source points at the destination at the same position
int[] destination = new int[] { 5, 0, 5, 0, 5, 0,…

Martin O'Donnell
- 111
- 6
1
vote
0 answers
What is the Pseudo-Hillbert curve equivalent for hexogonal and triangular tesselations?
Triangles, squares and hexagons can all be used to fill a surface (tessellation).
For now let's assume the surface has a limited number of tiles (triangles, squares or hexagons)
The goal is to define a line that touches each tile so that points that…

Rutger Hofste
- 4,073
- 3
- 33
- 44
1
vote
1 answer
Transform 3D coordinates to index of a space-filling curve (Peano, Hilbert...)
While transformation of 3D coordinates to a z-order curve was relatively straightforward (Efficient z-order transformation in Fortran) I am having difficulties to wrap my head around around the math for using different space-filling curves, for…

MechEng
- 360
- 1
- 13
1
vote
0 answers
Hilbert Curve: Implementing for N-Dimensions
The Hilbert curve Wikipedia article includes some C code that shows how to map coordinates to the curve but it only works for two-dimensions. I'm having trouble finding any examples that work for N-dimensions (curve examples are plentiful but not…

Dustin Oprea
- 9,673
- 13
- 65
- 105
1
vote
1 answer
Morton Encoding Z-indexing Space Usage
I am a bit confused as I have tested a couple algorithms to compute z-indices and for (8, 8, 8) I get 3584 and for (7, 7, 7) I get 511, which is correct. The issue is 8*8*8 = 512, yet the z-index is 3584. That means if I use a one dimensional…

SwiftMatt
- 949
- 1
- 9
- 19
1
vote
1 answer
2D cache-friendly data structures and space-filling curves
I've read that space-filling curves such as the Peano curve are useful for maintaining cache-friendly data structures in a linear address space, since they maintain physical spatial locality.
However, I'm not sure how to actually use them. Do any of…

user541686
- 205,094
- 128
- 528
- 886