You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Data3DPointsData_t, the fields for E57_EXT_surface_normals are declared as floats:
float *normalX = nullptr; //!< The X component of a surface normal vector (E57_EXT_surface_normals extension).float *normalY = nullptr; //!< The Y component of a surface normal vector (E57_EXT_surface_normals extension).float *normalZ = nullptr; //!< The Z component of a surface normal vector (E57_EXT_surface_normals extension).
And they are explicitly written as floats:
// currently we support writing normals only as float32if ( data3DHeader.pointFields.normalXField )
{
proto.set( "nor:normalX", FloatNode( imf_, 0., E57_SINGLE, -1., 1. ) );
}
I'm not sure why this restriction is here, but the spec for the extension allows for both floats and doubles (and uses doubles in their examples).
Edit: Should look at supporting scaled ints (see below).
The text was updated successfully, but these errors were encountered:
I'm not sure whether there is any real need to have normals in doubles. Normals should be of unit length and float has more than enough precision within [-1, 1] range to capture normals for the point precision achievable with the best scanners. The example uses ScaledIntegerNode, which might be worth supporting, quantisation of normals is quite common technique to save space. With that said, I'm not sure how many users who are happy to quantise would use E57, they might want to use draco compression anyway.
Ah quite right! I missed that - I just saw all the doubles everywhere 😄
Adding a way for it to use scaled ints seems like it should be straightforward and would make sense to me.
asmaloney
changed the title
Simple API implementation of E57_EXT_surface_normals doesn't handle doubles
Simple API implementation of E57_EXT_surface_normals doesn't handle scaled ints
Oct 31, 2022
In
Data3DPointsData_t
, the fields for E57_EXT_surface_normals are declared as floats:And they are explicitly written as floats:
I'm not sure why this restriction is here, but the spec for the extension allows for both floats and doubles (and uses doubles in their examples).Edit: Should look at supporting scaled ints (see below).
The text was updated successfully, but these errors were encountered: