You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Transformation is everything in the codebase that aint Formatting and Parsing, for example sorting vertices and moving them to correct tree type. This code is as of writing this marked/experimental unstable in the master branch and will probably be for a while since I have many breaking changes planned and there are no unit tests since a upcoming refactoring could cause me to remove some of the unit tests. I plan to add unit tests whenever the codebase stabilizes.
How does transformation work?
You’ve got a raw data structure (Node) that describes vertices and beams (kind of like a messy blueprint). The goal is to clean it up, reorganize the vertices, and rename them consistently.
Here’s how the modules work together:
SupportVertex
Scans the "beams" section.
Counts how many connections each vertex has.
Produces a map of vertex → connection count.
This helps later to spot support vertices (the ones holding stuff up).
VertexExtraction
Digs into the "nodes" section.
Reads raw vertices, pulls out metadata and comments.
Groups them into a VertexForest (trees like Left, Middle, Right, Support).
Handles global vs. local metadata so values aren’t duplicated.
Transformation
Takes the VertexForest + the connection map from SupportVertex
Decides where each vertex belongs (Left/Middle/Right/Support).
Sorts them in order, groups them by prefix, and renames them with consistent IDs (l1, m2, r3…).
Rewrites the whole Node tree with the updated vertices.
Updates all other references to these vertices so names stay in sync.
End result
The input data becomes a neat structure:
Vertices are in the right groups.
Support vertices are identified and placed correctly.
Metadata is cleanly separated into global vs. local.
Names are consistent and collisions are avoided.
Basically, the system turns raw vertex + beam data into a well-organized, fully updated node tree ready for further use.
Transformation refactoring: split Transformation into different files and added improved how comments and metadata is handled when moving vertices Transformation.hs refactoring #41
Dvivide by 100 and save the value as annVertexCount
Determine if the amount of connections for the vertex in the whole mesh are higher than annVertexCount
Ideally it should instead work like something like this:
Count direct connections: For each vertex in the VertexTree, count how many direct connections (edges) it has to other vertices.
Compute the threshold: Determine a threshold based on a percentage of the total number of vertices in the VertexTree. Only vertices whose number of direct connections exceeds this threshold are considered potential support vertices.
Identify potential support vertices: A vertex with many direct connections, especially when the vertices it connects to themselves have relatively few connections back. likely serves as a support vertex.
In other words, vertices that act as hubs, with a high proportion of connections relative to the size of the VertexTree, are more likely to be support vertices.
Currently, when multiple VertexTrees are combined, such as when there are multiple vertex prefixes for a single VertexTree type, a comment is added to indicate the combination. However, comments that appear at the top of some of the individual VertexTrees may be lost during this process and not preserved in the final combined VertexTree. This will be fixed.
What is transformation?
Transformation is everything in the codebase that aint Formatting and Parsing, for example sorting vertices and moving them to correct tree type. This code is as of writing this marked/experimental unstable in the master branch and will probably be for a while since I have many breaking changes planned and there are no unit tests since a upcoming refactoring could cause me to remove some of the unit tests. I plan to add unit tests whenever the codebase stabilizes.
How does transformation work?
You’ve got a raw data structure (Node) that describes vertices and beams (kind of like a messy blueprint). The goal is to clean it up, reorganize the vertices, and rename them consistently.
Here’s how the modules work together:
SupportVertex
VertexExtraction
Transformation
End result
The input data becomes a neat structure:
Basically, the system turns raw vertex + beam data into a well-organized, fully updated node tree ready for further use.
Previous changes
Remaining problems as of September 2025
Better support vertex detection:
Currently this is how vertices are detected:
So basically it works like this:
Ideally it should instead work like something like this:
In other words, vertices that act as hubs, with a high proportion of connections relative to the size of the VertexTree, are more likely to be support vertices.
Better comment handling:
Currently, when multiple VertexTrees are combined, such as when there are multiple vertex prefixes for a single VertexTree type, a comment is added to indicate the combination. However, comments that appear at the top of some of the individual VertexTrees may be lost during this process and not preserved in the final combined VertexTree. This will be fixed.