2025年11月22日星期六

Tech Art - Week14 - Simple Tool Design & Implementation

 

Result


Assignment Review

As always, before doing any implementation, I first restated the assignment clearly.
In short, we need to read a GeoJSON file, convert it into geometry in Houdini, and assign a different color to each region.


Approach

From reading through the task description, the difficult part of this assignment is not the procedural modeling itself.
The handout even provides example code that shows how to use a Python SOP to create geometry from point data.


The real challenge is how to extract the information we need from the GeoJSON file.
By checking online references and opening the GeoJSON in a text editor, I clarified the overall data structure: each entry contains information such as Feature, Properties, and Geometry, and the geometry can be either a single Polygon or a MultiPolygon.
The most important field is coordinates, which stores the vertex positions of every region.

One thing to pay attention to: in GeoJSON, coordinates are 2D (longitude, latitude), while in Houdini we work in 3D space, so we need to convert them.

Json-Info-Extraction


Once all the necessary information has been read from the GeoJSON file, the rest becomes relatively straightforward.
This assignment is purely about data visualization, and doesn’t involve object interactions or complex behaviors.
As long as the data-processing flow is clean and well structured, it’s easy to keep the overall logic clear.
Based on the assignment prompt and the way we extracted data from the JSON file, I split the whole assignment into four major functional parts to implement.


For the procedural modeling part using a Python SOP, polygons that contain holes require special handling.
We cannot directly create holes using only the Python SOP polygon, so we need to combine it with a Boolean node to fully support all these cases.

Taking “Kyrgyzstan” as an example, this region is of type Polygon and contains a hole in the middle that needs to be cut out.

Polygon-Kyrgyzstan-Hole-Example

Taking “Armenia” as another example, this region is of type MultiPolygon and also has inner areas that must be subtracted as holes.

MultiPolygon-Armenia-Hole-Example

Final Result & Demo



P4V


没有评论:

发表评论