Skip to main content
14-Alexandrite
Aug 28, 2026 12:06 PM UTC
Solved

How to build a best fit plane through a cloud of points

Hello 

I have a lot of measured points and like to create a best fit plane through these points.
Does Creo provide such an option?

Many thanks in advance for your help.

Regards Pius

PiusAnswer
14-Alexandrite
Sep 1, 2026 12:04 PM UTC

I somehow lost my comment from yesterday.

I did almost the same but in Excel.
In the Excel (where I have my coordinate) I asked Copilot to calculate a best fit plane through all the points.
Than I took the best fit plane function/formula and inserted the Y and the Z values for 3 matching points, E.G.:
Y=0, Z=0
Y=1000, Z=-250
Y=0, Z=-500
This gave me the X coordinates of tree points on the best fit plane.
These coordinates I entered into the Datum Point Editor in Creo and used them for the “best fit plane”.
I guess it’s what you suggest just with Excel.

Sorry, I thought yesterday this note was already in the chat but seems to be lost somewhere.
But Thank you anyway

15 replies

StephenW
23-Emerald III
Aug 28, 2026 12:39 PM UTC

I don’t think with Creo Parametric there is an option like that.

I think the the manufacturing add in for CMM in Creo has something like that to create construction planes for measuring.

Translate
Pius14-AlexandriteAuthor
14-Alexandrite
Aug 28, 2026 12:54 PM UTC

We have these licences, do you think it is included in one of them?
 

 

Translate
13-Aquamarine
Sep 1, 2026 2:28 PM UTC

My guess is that you would need the REX extension for reverse engineering.

Translate
StephenW
23-Emerald III
Aug 28, 2026 1:51 PM UTC

I do not know.  I would suggest contacting your VAR or PTC to understand what license would be needed and if you have it.

A google search showed the following: 

To access and use the Coordinate Measuring Machine (CMM) manufacturing module in Creo Parametric, you need the optional Pro/CMM extension license (historically and internally referred to as Pro/CMM or CMM Manufacturing). [1, 2, 3, 4]

License Details

  • Module Name: Pro/CMM (CMM Inspection Programming)
  • Function: Allows you to generate associative inspection and probing programs for CMM hardware directly from your 3D models.
  • Requirement Type: It is an add-on option/extension that must be explicitly added to your existing locked or floating license configuration (such as Creo Design Essentials or Advanced). [1, 2]

How to Check if You Have the License

  • Open Creo Parametric.
  • Go to File > Help > System Information.
  • Look at the information window under Configured Option Modules to see if CMM or Pro/CMM is listed.
  • If it is missing, you will need to contact your software administrator or PTC representative to add the extension to your license file. [1, 2, 3]

Translate
Pius14-AlexandriteAuthor
14-Alexandrite
Aug 28, 2026 2:01 PM UTC

Thanks for help.

Unfortunately, they are not listed.
☹️

Translate
RPN
18-Opal
Aug 29, 2026 9:05 AM UTC

Assume you want to create a single plane through N points of measurement you can use Least Squares because a plane is parameterized by a single equation. The result is the best fit.

 

import numpy as np

# Your 10 points as a (10, 3) array
points = np.array([
[x1, y1, z1],
[x2, y2, z2],
# ... 10 rows total
])

# 1. Compute centroid and center the points
centroid = points.mean(axis=0)
centered = points - centroid

# 2. SVD of the centered points
U, S, Vt = np.linalg.svd(centered)

# 3. Normal vector = last row of Vt (smallest singular value)
normal = Vt[-1]
a, b, c = normal
d = -normal.dot(centroid)

print(f"Plane: {a:.4f}x + {b:.4f}y + {c:.4f}z + {d:.4f} = 0")
print(f"Normal vector: {normal}")
print(f"Point on the plane (centroid): {centroid}")

# Optional: mean squared distance as a goodness-of-fit measure
distances = centered.dot(normal)
rmse = np.sqrt(np.mean(distances**2))
print(f"RMSE (orthogonal distance): {rmse:.6f}")

Code by Claude, not tested with the SVD-Instance

Translate
Pius14-AlexandriteAuthor
14-Alexandrite
Aug 31, 2026 7:47 AM UTC

Hello RPN
This sounds some how be doable.
I understand that the points don’t need to be physically in the 3D model, but they are part of the equation? Which would be okay.
But where can I enter such a equation? 
I have now idea?

Translate
Pius14-AlexandriteAuthor
14-Alexandrite
Aug 31, 2026 11:37 AM UTC

I did enter the computing program into the d=Relations Editor just copy paste the main part, but inserting a few coordinates of my measured points.
When I try to compute the program the first line “import numpy as np” already was highlighted like: errorExtra symbols found - ignored. !
than every line containing the coordinates where highlighted like: errorInvalid number in relation. 

My impression is, that the string “import numpy as np” is unknown to creo.

Does anyone have further ideas?

Translate
RPN
18-Opal
Sep 1, 2026 9:39 AM UTC

No, you can’t do that in this way. Do most not in Creo. Read your point from an Input file, calculate the plane, get 3 Points on this plane, create a datum in Creo with this 3 points.

The code above is in python. I don’t work with python, but ask ChatGPT for a solution in a programming language you like.

Translate
Pius14-AlexandriteAuthorAnswer
14-Alexandrite
Sep 1, 2026 12:04 PM UTC

I somehow lost my comment from yesterday.

I did almost the same but in Excel.
In the Excel (where I have my coordinate) I asked Copilot to calculate a best fit plane through all the points.
Than I took the best fit plane function/formula and inserted the Y and the Z values for 3 matching points, E.G.:
Y=0, Z=0
Y=1000, Z=-250
Y=0, Z=-500
This gave me the X coordinates of tree points on the best fit plane.
These coordinates I entered into the Datum Point Editor in Creo and used them for the “best fit plane”.
I guess it’s what you suggest just with Excel.

Sorry, I thought yesterday this note was already in the chat but seems to be lost somewhere.
But Thank you anyway

Translate
RPN
18-Opal
Sep 2, 2026 4:17 AM UTC

Can someone of the admins explain why this thread has not all messages here!

Some answers are definitely no longer listed, why? Is it buggy here?

Translate
StephenW
23-Emerald III
Sep 2, 2026 10:10 AM UTC

​@RPN  The new community provider auto-collapses (if that is a real thing) multiple replies to a post. You have to watch for the “x replies”  under a post to see if  has collapsed them.

 

Translate
RPN
18-Opal
Sep 2, 2026 8:20 PM UTC

Thank you 🎊🎈🪅, so minimum 2 people stumbled over the new feature 😅

And what is the reason that sometimes you can give an answer on every item, and sometimes not one at all😅

Translate