Skip to content

Voronoi edges #32

@himcraft

Description

@himcraft

The function TetGen.voronoi() seems giving wrong results. I think Voronoi diagram should contain no nodes from the input by definition.

I want to generate a Voronoi diagram of points distributed in a cube, but the function gives this result:

julia> points
18-element Vector{Point3{Float64}}:
 [0.08456788617387545, 0.6497784220953491, 0.7651525711446618]
 [0.028556399240840413, 0.2317874394033026, 0.468892769192472]
 [0.26632804301123825, 0.8186148060679752, 0.7773876008016107]
 [0.13291567046032693, 0.07110853378792514, 0.6820381594695846]
 [0.9962270232031032, 0.5826099098133337, 0.578540445051634]
 [0.16635112279720943, 0.5001270334521524, 0.6245013162465198]
 [0.2314725162222675, 0.9871353669436038, 0.7652880990761379]
 [0.11753264631398874, 0.8913434319674096, 0.0834823244596401]
 [0.5786593524030887, 0.9099420749225255, 0.40876829495504174]
 [0.6076092814573353, 0.8845532830403793, 0.34616515245781887]
 [0.0, 0.0, 0.0]
 [0.0, 0.0, 1.0]
 [0.0, 1.0, 0.0]
 [1.0, 0.0, 0.0]
 [1.0, 1.0, 0.0]
 [1.0, 0.0, 1.0]
 [0.0, 1.0, 1.0]
 [1.0, 1.0, 1.0]

julia> TetGen.voronoi(points)
Mesh{3, Float64, Triangle}:
 Triangle([0.0, 1.0, 0.0], [0.0, 1.0, 1.0], [1.0, 1.0, 1.0])
 Triangle([0.0, 1.0, 1.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0])
 Triangle([0.0, 0.0, 1.0], [1.0, 0.0, 1.0], [1.0, 1.0, 1.0])
 Triangle([0.0, 1.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 1.0])
 Triangle([0.0, 1.0, 1.0], [0.0, 0.0, 1.0], [1.0, 1.0, 1.0])
 Triangle([1.0, 1.0, 1.0], [1.0, 0.0, 1.0], [1.0, 0.0, 0.0])
 Triangle([0.0, 0.0, 0.0], [0.0, 1.0, 0.0], [1.0, 0.0, 0.0])
 Triangle([0.0, 1.0, 0.0], [1.0, 1.0, 1.0], [1.0, 1.0, 0.0])
 Triangle([0.0, 1.0, 0.0], [1.0, 1.0, 0.0], [1.0, 0.0, 0.0])
 Triangle([0.0, 0.0, 1.0], [0.0, 0.0, 0.0], [1.0, 0.0, 0.0])
 Triangle([1.0, 0.0, 1.0], [0.0, 0.0, 1.0], [1.0, 0.0, 0.0])
 Triangle([1.0, 1.0, 0.0], [1.0, 1.0, 1.0], [1.0, 0.0, 0.0])

It is clearly not a correct Voronoi diagram. I tried vo=tetrahedralize(JLTetGenIO(points),"v"), it prompts Writing Voronoi edges. But I cannot see any Voronoi-related data in the struct of vo.

So could you please help me with how I can find the correct Voronoi edges information?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions