1
$\begingroup$

I am trying to display multiple polygons, from a list of vertices, in blender using the sverchok addon. For this project, the polygons are Madagascar and the rest of Africa. Here are the project files, which include the blend file, list of vertices (csv file), and screenshot of node setup: https://drive.google.com/file/d/116p-ee0Kfepi6Bimn28tdLYf-3kKryQD/view?usp=sharing

The csv file has the following columns (relevant columns are bold):

  • fid = index of all the vertices in the list (ranges from 1 to 405 for the 405 total vertices in the list)
  • CONTINENT = ignore this column, was generated earlier in GIS, should not be relevant now
  • Geom2 = ignore this column, was generated earlier in GIS, should not be relevant now
  • vertex_index = index of the vertices unique to each polygon (ranges from 0 to 355 for the 356 vertices making up mainland Africa, then ranges from 0 to 48 for the 49 vertices making up Madagascar)
  • vertex_part = index of the polygons, 0 = Africa (mainland), 1 = Madagascar
  • vertex_part_ring = ignore this column, was generated earlier in GIS, should not be relevant now
  • vertex_part_index = same as the vertex_index column
  • distance = ignore this column, was generated earlier in GIS, should not be relevant now
  • angle = ignore this column, was generated earlier in GIS, should not be relevant now
  • x = x-coordinate of vertex (longitude, in decimal degrees)
  • y = y-coordinate of vertex (latitude, in decimal degrees)

Using the sverchok addon, I was able to get a working node setup:

enter image description here

Where the vertices are filtered by the vertex_part value. However, in order to display both polygons I had to duplicate the node setup, and change the vertex_part value for the second node setup (i.e. the only difference between the Africa and Madagascar frames is the Y value in the "Equal" logic node).

So, my question is, is there a way to filter/display/list the vertices so that I do not have to duplicate the node setup for every new polygon?

Although duplicating this node setup isn't much trouble for only a few polygons, I would like to work with larger datasets with many more polygons. For instance, duplicating the node setup would not be feasible if I were working with world-wide country data.

Thanks,

$\endgroup$

1 Answer 1

1
$\begingroup$

the only thing - join list node for 0,1 duality.
Also you can use wrap option of float2int output socket instead list join

if you have more that two options there should be other approach

enter image description here

$\endgroup$
1
  • $\begingroup$ Thanks nikitron, I really appreciate the help. I am curious how to achieve this for more than two polygons, but I will ask that in a separate question and put together another example dataset. $\endgroup$
    – MarcusR
    Commented Apr 15, 2021 at 0:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .