Best Fit line
Best Fit line
(OP)
Dear All,
I'm a new catia user and would have a question for you.
I'm using a mesuring device that produce a set of points in catia.
Does anyone knows a way to trace a best fit line through those points? (like linear regression ).
Thank you in advance for your help.
I'm a new catia user and would have a question for you.
I'm using a mesuring device that produce a set of points in catia.
Does anyone knows a way to trace a best fit line through those points? (like linear regression ).
Thank you in advance for your help.





RE: Best Fit line
You need to use method "GetCoordinates" (Member of HybridShapeTypeLib.Point)
Is it Yours school project or You need this for commercial use?
If You are interested in Macros in Catia (Catscripts, Catvba) feel free to send me a message. I will wrote specified macros for free and post it on eng-tips forum
RE: Best Fit line
CODE --> catvba
Here is a simple code to get coordinates from selected points
You can replace lines:
CODE -->
by this one:
CODE -->
Lukasz
If You are interested in Macros in Catia (Catscripts, Catvba) feel free to send me a message. I will wrote specified macros for free and post it on eng-tips forum
RE: Best Fit line
Your macro works just fine. I have some background in programming in C and Java but none in vbs.
I know i need to create a Type for coord
Then a array of my new type
Collect all the coord in my array.
I tried a bit but without proper knowledge of vbs, i couldnt succeed.
Writing the routine to best fit a line given the coordinates of point shouldnt be a problem.
RE: Best Fit line
Not in 2-D, but in 3-Dimensional space Line is referenced by 6 variables, 2 planes intersection (2x3variables) or vector[x,y,z] and passing point (xa,ya,za).
to create array dimensioned as below [number of points, coordinates] try to use this script:
CODE -->
If You are interested in Macros in Catia (Catscripts, Catvba) feel free to send me a message. I will wrote specified macros for free and post it on eng-tips forum