Fit a plane through selected vertices

I needed a method to efficiently add a plane to a mesh that is fitted to a potentially large set of selected vertices.

To this end I created a small add-on, PlaneFit, that does just that :slight_smile:

An example result is shown below:


A full write-up, including code explanation and download instructions can be found here.

Enjoy,

– Michel.

That is a great tool! Thank you!
(I would like to add this to t+ boolean. It is pferect therefore.)

please go ahead Marvin, that’s what open source is for :slight_smile: [mind that the script is not completely production ready, it doesn’t check whether at least 3 vertices are selected etc. so it might need some love.]

By the way, I only leaned from your tool collection just now and saw your GitHub: looks great but do you have a web page or somethting that describes the functionality available?

No, not yet! But in the addon preferences i added some url-links to threads, wikis, etc.
(…and i learned from you, too > bought once your cookbook! :wink:

FYI, made a tiny improvement, now it properly checks if at least 3 verts are selected.

enjoy,

– Michel.

Made a companion add-on to fit a line segment to a point cloud using the same principles. Code and explanationin this article.

enjoy,

– Michel.

Hey, thanks a lot! Very much appreciated!

Would anyone be willing to bring this old discussion up to date and re-do the plugin for the Blender4.0 family?

Otherwise great job and so far, worth it to keep the legacy version around.

Thanks.

Hi,

updated planefit.py for Blender 4.x

if I have the time I will try to fix linefit as well.

Cheers,

– Michel.

2 Likes

updated linefit.py too.

– Michel.

PS> for artists that are not too familiar with GitHub: Near the top right of the linked pages is a download button; click it to save the .py file, then (re)install the add-on in the usual manner. If you are familiar with GitHub it might be easier to clone the repo (Hint: I am always open to PRs :slight_smile: )

That’s too cool!
Tiny error, Line 84 np.bool to just boil and worked great.
Thank you, thank you.