incoherent face orientation in marching cubes

Juan Nunez-Iglesias jni.soma at gmail.com
Thu Jan 9 21:18:45 EST 2014


I think you mean

faces = np.concatenate((faces, faces[:, ::-1]), axis=0)

=)


On Fri, Jan 10, 2014 at 11:51 AM, Josh Warner <silvertrumpet999 at gmail.com>wrote:

> Calculate the gradient for each face, normalize it, and orient the face
> counterclockwise around the descent of said gradient vector.
>
> It would require some pretty heavy modification, but might be worth it.
>
> On the other hand, you could potentially hack in a fix (depends on how the
> STL package works) much easier by making the output double sided. A
> double-sided mesh has each face twice, covering both orientations This way
> you'd just append `faces` to itself, reverse indexing to flip the
> orientation of each face, e.g.
>
> ``` python
> import numpy as np
> from skimage.measure import marching_cubes
>
> verts, faces = marching_cubes(vol, value)
>
> faces = np.concatenate((faces, faces[:, -1], axis=0)
>
> # Remainder of STL export code for faces here
> ```
>
> Which would be *far, far* simpler and less computationally intense than
> dealing with the gradients...
>
> Would you mind trying this quick fix, Janto?
>
>
>
> On Wednesday, January 8, 2014 6:35:28 PM UTC-6, Stefan van der Walt wrote:
>>
>> Josh, you said you had some ideas on how to add this--could you expand?
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "scikit-image" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to scikit-image+unsubscribe at googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20140110/acad2855/attachment.html>


More information about the scikit-image mailing list