Group Abstract Group Abstract

Message Boards Message Boards

2
|
13.2K Views
|
5 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Voronoi and borders

POSTED BY: André Dauphiné
5 Replies
POSTED BY: Henrik Schachner
POSTED BY: Henrik Schachner

Unfortunately I do not have much experience in working with regions. But I find your question so interesting that I am trying now a "solution":

ClearAll["Global`*"]

pays = "France";
ny = ToExpression@
   DialogInput[
    DynamicModule[{name = ""}, 
     Column[{"How much cities?", InputField[Dynamic[name], String], 
       ChoiceButtons[{DialogReturn[name], DialogReturn[]}]}]]];
coord = Take[
   Table[Reverse[CityData[c, "Coordinates"]], {c, 
     CityData[{All, pays}]}], ny];
border = ConvexHullMesh[coord];   (* !!! *)
voron = VoronoiMesh[coord];
chm = ConvexHullMesh @@@ MeshPrimitives[voron, 2];

(* here is my idea: the individual intersection of the complete
region with every Voronoi tile: *)
ri = RegionIntersection[border, #] & /@ chm;
grLines = MeshPrimitives[#, 1] & /@ ri;
gr = Graphics[grLines]
DiscretizeGraphics[gr]

While this is quite a crude approach, I am sure there are much more elegant solutions. Maybe someone is going to give a hint.

Cheers Henrik

POSTED BY: Henrik Schachner

Splendid Can I have your adress mail

Bonnes et joyeuses fetes

André Dauphiné

POSTED BY: André Dauphiné

Thanks, It's OK André

POSTED BY: André Dauphiné
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard