Skip to content

feat: added conversion code from many plot types to curve profile#32

Merged
Schnjan merged 1 commit into
developfrom
feature/CurvePlotConversion
May 2, 2025
Merged

feat: added conversion code from many plot types to curve profile#32
Schnjan merged 1 commit into
developfrom
feature/CurvePlotConversion

Conversation

@Schnjan
Copy link
Copy Markdown
Collaborator

@Schnjan Schnjan commented Apr 30, 2025

Adds conversion code to curve profile. This is needed to display plots of different types in the cad element.

Comment thread src/Formplot/FileFormat/Vector.cs Outdated

public static Vector operator *( double b, Vector a )
{
return new Vector( a.X * b, a.Y * b, a.Z * b );
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can keep logic at one place.

Suggested change
return new Vector( a.X * b, a.Y * b, a.Z * b );
return a * b;

Comment thread src/Formplot/FileFormat/Vector.cs Outdated
var l = Math.Sqrt( X * X + Y * Y + Z * Z );
return l == 0.0
? new Vector( 0 )
: new Vector( X / l, Y / l, Z / l );
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not using the operator?

Suggested change
: new Vector( X / l, Y / l, Z / l );
: this / l;

@Schnjan Schnjan force-pushed the feature/CurvePlotConversion branch from f0a7c27 to 259a818 Compare May 2, 2025 09:30
@Schnjan Schnjan merged commit ca8db6d into develop May 2, 2025
3 checks passed
@Schnjan Schnjan deleted the feature/CurvePlotConversion branch May 2, 2025 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants