Modifying TSpline-Vertices via API

Modifying TSpline-Vertices via API

sonstwienix
Enthusiast Enthusiast
875 Views
2 Replies
Message 1 of 3

Modifying TSpline-Vertices via API

sonstwienix
Enthusiast
Enthusiast

Hi,

i am trying to write a plugin that can optimize a TSpline-Loft for minimum suface area. This is helpful for fabric design and stuff. I succeeded so far to implement an algorithm that modifies a normal surface loft and creates a minimum-surface mesh from it. But it is mesh based, therefore the output is a real performance killer, since hundreds of faces get created. Having the same functionality for a TSpline-Loft would make the output more long-term usable.

 

However i am very unsatisfied with the API at this point. TSplines seem really not well cared for. All i can do is to get a TSM string description and can create a TSpline from such description. But this format is not documented - so i really cant so anything useful with it, as i cannot modify the TSM-desc with any purpose.

I have so far found no functions to enumertate the vertices of a TSpline nor create a TSpline from a Vertex and Edge-Description (which i guess a TSM-string is, actually - DOCUMENT IT!!). I have also not found any way to add a TSpine-Body virtually to evaluate its surface area without explicitly going into the form-environment and creating and removing bodies. This is a performance killer for an iterative solver.

Basically all i need to do is to shift vertices around along their normal. Nothing too crazy, but it is impossible.

Can anyone help with this?
I am open to cooperate with Autodesk - a Lofting mode that generates a minimum surface area might be cool after all.

0 Likes
876 Views
2 Replies
Replies (2)
Message 2 of 3

kandennti
Mentor
Mentor

Hi @sonstwienix .

 

Unfortunately, I don't think the API for operating the T-spline Body is open to the public.

 

 

In the past, there was a discussion in the Japanese forum about using the API to manipulate the vertices of a T-spline body.

At that time, I searched the web and found this document.

https://iranarze.ir/wp-content/uploads/2016/11/E524.pdf 

It was too difficult for me to understand.

 

Also, I found this package on github.

https://github.com/GrapeTec/T-SPLINE 

There is a tsm file in the rhino folder.
I imported it with this add-in that I have published, and it seems to import correctly.

https://github.com/kantoku-code/Fusion360-TSplineBodyDoorway 

 

I think the format of the tsm file in Fusion360 is the same as the one in this package, so I think it may be possible to use it.

 

0 Likes
Message 3 of 3

sonstwienix
Enthusiast
Enthusiast

Thank you so much for your response.

I am currently considering to change my approach to this endeavor.

I might try to triangulate a surface that just connects edge end points (minimum triangulation of a polygon).

From there i can generate points within the triangles (in a, lets say, 8x8 grid) and join them using a set of splines which can be generated in a sketch.
Then the length of the splines can be minimized.
From there a Loft-Feature might work to reconstruct the surface with relatively ease, using 2 triangle edges and parallel splines as as profiles, and perpendicular splines plus the remaining triangle edge as rails.

 

I have currently no idea how to implement this, but it is a possible path to success.

The triangulation idea basically falls apart when the surface is defined by anything else than lines. Even in my target case, i use splines as surface edges. Triangulation would work in my case, but it is not generalized.

 

0 Likes