National-Composites-Centre / CompoST

This repository serves as reference point for standard classes for composite definition.
MIT License
3 stars 2 forks source link

[Feature]: Full definition of a spline #11

Open luke-ncc opened 1 week ago

luke-ncc commented 1 week ago

Describe the project you are working on

A simple CompoSt visualisation tool. This tool can be used to view surfaces, splines, and ply edges and cross-sections.

Describe what the format is lacking that you need in your project

Splines are usually defined by points with a "fit method", piecewise polynomials or points with tangents and direction. Currently, splines are defined just by points, which leaves ambiguity. In order to properly represent a spline in the visualiser, splines could be better defined in the data format.

State what specific feature could be added for what you need to represent

Definition of a spline should be complete in the data format. This might be adding extra parameters for each point other than x, y and z, a spline-wide definition for every point or a file-wide definition of splines.

Suggest how the feature could be implemented to support this project as well as future projects that might need this feature

Implementation 1: Points and fit method. Define a list of points and a fit method. See Autodesk help | SPLINE (Command). This is most similar to the current implementation, but better defines the spline with parameters.

Implementation 2: Points and tangents. This would mean adding a 3-d vector tangent to each point to define the spline.

Implementation 3: Piecewise polynomials. This would involve defining a polynomial for each section of the spline. This would be more complicated to implement but could be more accurate.

Can this feature be represented already by combining other features?

Spline definition can be assumed, but this would lead to inaccuracies in models with fewer defined splines, and even differences between different representations of the same file if interpreted in different ways.

Version

v0.67

JKucera-NCC commented 5 days ago

The planned short term resolution is to use the "breaks" list available as part of spline definition. This should be list of integers corresponding to points in spline that define spline break points. This resolves sharp changes in spline (such as corners). With sufficient points, spline interpolation has minimal effect.

Currently splines are mostly exported from CAD software, and it is not easy to extract the additional information (as the spline generation algorithms tend to be proprietary - not visible). Similarly, if the information is provided, most simulation software will not be able to import spline according to the extra information suggested. Instead, user would generate additional points to get close to intended spline, this is possible within current CompoST.

Based on future applications/workflows the full implementation of 1 or more of the suggestions above might considered at some point.