« Return to Thread: Bug or refactoring artifact?

Re: Bug or refactoring artifact?

by Daniel Scott Matthews :: Rate this Message:

Reply to Author | View in Thread

On Fri, Jun 26, 2009 at 8:13 AM, Bart Janssens<bart.janssens@...> wrote:

> On Wed, Jun 24, 2009 at 4:42 AM, Timothy M. Shead<tshead@...> wrote:
>>> Daniel Scott Matthews wrote:
>>>> I am seeing this on the console when importing with both the OBJ and
>>>> the 3DS mesh readers.
>>>>
>>>> ERROR: /home/daniel/projects/k3d/k3dsdk/normal3.h line 207: assertion
>>>> `length' failed
>>>
>>> This message indicates that we're trying to normalize a zero-length
>>> normal vector, which would cause a divide-by-zero error if we didn't
>>> catch it.  Could you send a small sample OBJ that causes this message?
>>
>> After loading a modest example sent by Daniel, I'm able to reproduce this.
>>  After putting an assert() in k3dsdk/normal3.h, I can see that this
>> computation is happening in the painter cache code, so I'm going to hand
>> this off to Bart ...
>
> Well, I've traced back the problem to two bad faces in the source
> mesh. The faces appear to be reduced to a single point, so no normal
> can be calculated. The first attached image shows these faces moved up
> 5m.
>
> The missing wheels are a mystery to me, but this happens in both K-3D
> and XSI Mod Tool. This is
> unrelated to the normals error. Are you sure everything was exported properly?
>
> In order to select and move the bad faces, I made the following changes in SVN:
> - Made normals_cache print the index of bad faces
> - Added a FaceToPointSelections plugin, to convert face selections to points
> - Fixed a bug with mesh_simple_deformation_modifier that prevented
> selection from working correctly
>
> You should now be able to use the following procedure to identify or
> fix bad faces:
> - Look in the debug output for the bad face numbers
> - Select a bad face using SelectFaceByNumber
> - Convert this selection to points using FaceToPointSelections
> - Apply a modifier, i.e. TranslatePoints or JoinPoints (needs to be
> restored to the new mesh format)
> - Click the "Clear" button on this modifiers mesh_selection property,
> so only the points belonging to the bad face get affected
>
> The real solution for this would be a plugin that helps cleaning up
> meshes and does things like removing faces smaller than a threshold.
>

I can't answer the question re the missing wheels, I'll just have to
keep an eye out for that happening again in another file.

Thanks for finding the issue with the normals, I agree with you about
the need for a mesh cleaning tool. Have you looked at MeshLab, it has
a tool-set for such tasks, perhaps their are parts of MeshLab that
K-3D can incorporate?  http://meshlab.sourceforge.net/

------------------------------------------------------------------------------
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development

 « Return to Thread: Bug or refactoring artifact?