Jump to content
Gustaf Magnander

translation of a real value to a normalized value for the point type "position on curve"

Recommended Posts

Dear forum members,
Is there an easy way to find the normalized value, that represent a certain real z-value, that I can use for the "Tp-value" when using the point type "position on curve"?
 

Thanks,
//Gustaf

Share this post


Link to post
Share on other sites
49 minutes ago, Mr. Heinrich von Zadow said:

Hi Gustav,

you could create a point through the console with:


point p(curve.fv(2,zVal))

Instead of "curve" you'll have to choose your particular curve and zVal would be your z value. "2" corresponds to the z-axis (0=x, 1=y, 2=z).

Thank you Heinrich, I will try this and also the ft alternative that you suggested
 

//Gustaf

Share this post


Link to post
Share on other sites

Hi again Heinrich,
I tested what you suggested and the points were created, but the position was wrong. I attach an image so it becomes easier to explain what I want to do. 

The point I have marked "1" is the point which has the z-value I want to use. The red cross marks the approximate position on the curve where I want the new point to be. The point in the bow which I have marked with "2" is where the point actually is positioned after creating the point with: point p(curve.fv(2,zVal)). 

I also tested the command: point p(curve.ft(2, zVal)) but then the point was positioned really far aft (not visible on the screenshot).

I hope this helps to describe my problem.

Thanks again!

//Gustaf 

CAESES_1.png

Share this post


Link to post
Share on other sites
1 minute ago, Gustaf Magnander said:

Hi again Heinrich,
I tested what you suggested and the points were created, but the position was wrong. I attach an image so it becomes easier to explain what I want to do. 

The point I have marked "1" is the point which has the z-value I want to use. The red cross marks the approximate position on the curve where I want the new point to be. The point in the bow which I have marked with "2" is where the point actually is positioned after creating the point with: point p(curve.fv(2,zVal)). 

I also tested the command: point p(curve.ft(2, zVal)) but then the point was positioned really far aft (not visible on the screenshot).

I hope this helps to describe my problem.

Thanks again!

//Gustaf 

CAESES_1.png

I could also say that the b-spline in the center works as a control curve and controls the outer generic curve in the z-direction. The point on the b-spline which is marked with "1" thus also has the correct x-value. I control the generic outer curve in the xy-plane with a multisegmented curve (not visible in the screenshot). 

Share this post


Link to post
Share on other sites

Hi Gustav,

in your case you would have to us p2:z as elevation for the fv command:

point p1(curve.fv(2,p2:z))

let me know if this explains it -- otherwise feel free to attach your particular example and I'll quickly modify it.

Cheers,
Heinrich

Share this post


Link to post
Share on other sites
6 minutes ago, Mr. Heinrich von Zadow said:

Hi Gustav,

in your case you would have to us p2:z as elevation for the fv command:


point p1(curve.fv(2,p2:z))

let me know if this explains it -- otherwise feel free to attach your particular example and I'll quickly modify it.

Cheers,
Heinrich

Hi Heinrich,
I actually use :z to get the z-value, see attached screenshot. 
 

CAESES_2.PNG

planing_hull_v03.cdb

Share this post


Link to post
Share on other sites
12 minutes ago, Gustaf Magnander said:

Yea, it was, 🙂
Thank you Heinrich!

actually Heinrich,
The x-value of the maxZ point was set as a discrete value. I want to automaticly retrieve this x-value based on the maxZ point, which change position if I vary the shape of the "knuckleRaiseCurve"  Thus, if I vary the shape of the "knuckleRaiseCurve" in the xz-plane the point maxZ automatically get the max z-value, but I want to automatically also retreive the correspoinding x-value, when maxZ position changes.

Share this post


Link to post
Share on other sites

Hi Gustaf (sorry for misspelling your name repeatedly!),

with .getmax(2,true) you can return the max value along the z-axis of a curve (the "true" will return the parameter position of that max value, instead of the value itself). This parameter can now be used again, to acces the position of the curve at that parameter with .getPos() 

This should be what you need -- see attached project again for your specific example.

 

planing_hull_v03.cdb

Share this post


Link to post
Share on other sites
1 hour ago, Mr. Heinrich von Zadow said:

Hi Gustaf (sorry for misspelling your name repeatedly!),

with .getmax(2,true) you can return the max value along the z-axis of a curve (the "true" will return the parameter position of that max value, instead of the value itself). This parameter can now be used again, to acces the position of the curve at that parameter with .getPos() 

This should be what you need -- see attached project again for your specific example.

 

planing_hull_v03.cdb 932 kB · 0 downloads

Hi Heinrich,
No worries!
Thank you, yes, I wanted to have the parameter position corresponding to the max z value. I will have a look in the project you fixed. Thanks again!

//Gustaf

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...