[Bf-committers] Cursor to center of mass

Ummi Nom umminom at gmail.com
Thu Nov 22 00:06:06 CET 2012


Hi!

I finished writing some testing code (only prints out the cm though).
Planar convex/concave n-gon centroids should be correct and for closed
meshes there's the tetrahedron stuff which uses either "fake" tris from
polys or correct tris from tessfaces. Non-planar polys won't be correct
because of the quick triangulation (v[0], v[i-1], v[i]) and because a
flipped tri (vs polynormal) is always considered to have negative area.

http://www.pasteall.org/37425/python

On Thu, Nov 22, 2012 at 12:20 AM, Jason Wilkins
<jason.a.wilkins at gmail.com>wrote:

> Well, the calculation is used first to map the origin of the object
> and this discussion was just how to extend that to moving the cursor.
>
> As for it being because of n-gons, I do not think my model contained
> n-gons.  What I did was call the subdivide operator 4 times on one end
> of the model, which created a bunch of new quads.  Do quads count as
> n-gons in this case?
>
> I'll see if I can duplicate it and provide a .blend that narrows this
> down if there is a problem.
>
> On Wed, Nov 21, 2012 at 1:08 PM, patrick boelens <p_boelens at msn.com>
> wrote:
> >
> > Oops, I forgot this was about the cursor snapping and had something else
> in mind... My apologies. =)
> >
> >> From: p_boelens at msn.com
> >> To: bf-committers at blender.org
> >> Date: Wed, 21 Nov 2012 20:07:04 +0100
> >> Subject: Re: [Bf-committers] Cursor to center of mass
> >>
> >>
> >> I can sort of see the reasoning behind that, but I would also argue
> accuracy can be very important. Maybe it'd be worth it to make a "high
> quality" operator bool in the same vein as the "high quality normals" in
> the Solidify modifier?
> >>
> >> -Patrick
> >>
> >> > Date: Wed, 21 Nov 2012 17:36:19 +0001
> >> > From: sergej.reich at googlemail.com
> >> > To: bf-committers at blender.org
> >> > CC: bf-committers at blender.org
> >> > Subject: Re: [Bf-committers] Cursor to center of mass
> >> >
> >> > Hey Jason,
> >> >
> >> > currently there is a problem with n-gons when chalculating the center
> of mass.
> >> > The issue is that we don't have a good way of calculating centroids
> for n-gons and just use the vertex average, so the calculated origin will
> drift a little when your polygons have many vertices.
> >> > I'd prefer to just tirangulate the model and use the triangle
> centroids but after a discussion with Campbell we decided it's not worth
> allocating a bunch of faces just to get a litte more accuracy.
> >> >
> >> > Regards, Sergej.
> >> >
> >> > Am Di, 20. Nov, 2012 um 12:12 ,Jason Wilkins <
> jason.a.wilkins at gmail.com> schrieb:
> >> > Brecht, I figured that was what it did after testing it some, but
> >> > since subdividing a face caused the center to move slightly I had my
> >> > doubts. If it was vertexes I expected a really large move (since
> >> > there were 100 times as many vertexes in my subdivided face than the
> >> > rest of the model), but using faces or tets it should not move at all.
> >> > Did I find a bug?
> >> >
> >> > On Mon, Nov 19, 2012 at 5:05 PM, "Martin Bürbaum"
> >> > wrote:
> >> > > Just FYI - I did something similar ("Snap Cursor to Centroid") as a
> script a while back.
> >> > >
> >> > >
> http://projects.blender.org/tracker/index.php?func=detail&aid=30299&group_id=153&atid=467
> >> > >
> >> > > Cheers,
> >> > > Martin
> >> > >
> >> > > -------- Original-Nachricht --------
> >> > >> Datum: Mon, 19 Nov 2012 19:00:23 -0300
> >> > >> Von: Juan Pablo Bouza
> >> > >> An: bf-committers at blender.org
> >> > >> Betreff: [Bf-committers] Cursor to center of mass
> >> > >
> >> > >>
> >> > >> Hi! The addition of the "center of mass" option for object origins
> is
> >> > >> really cool!
> >> > >>
> >> > >> Now, there are many times in rigging when you need the center of
> the
> >> > >> object to be at 0 0 0, specially for exporting meshes. So, in these
> >> > >> cases, the "origin to center of mass" option would not be used.
> >> > >> Nevertheless, the center of mass options would be really usefull
> for
> >> > >> placing objects such as bones...
> >> > >>
> >> > >> So, I propose to add the center of mass option also in the Cursor
> >> > >> snapping menu (shif+S). That would be "cursor to center of mass".
> >> > >>
> >> > >> Cheers!
> >> > > _______________________________________________
> >> > > Bf-committers mailing list
> >> > > Bf-committers at blender.org
> >> > > http://lists.blender.org/mailman/listinfo/bf-committers
> >> > _______________________________________________
> >> > Bf-committers mailing list
> >> > Bf-committers at blender.org
> >> > http://lists.blender.org/mailman/listinfo/bf-committers
> >> >
> >> > _______________________________________________
> >> > Bf-committers mailing list
> >> > Bf-committers at blender.org
> >> > http://lists.blender.org/mailman/listinfo/bf-committers
> >>
> >> _______________________________________________
> >> Bf-committers mailing list
> >> Bf-committers at blender.org
> >> http://lists.blender.org/mailman/listinfo/bf-committers
> >
> > _______________________________________________
> > Bf-committers mailing list
> > Bf-committers at blender.org
> > http://lists.blender.org/mailman/listinfo/bf-committers
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>


More information about the Bf-committers mailing list