MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / vertex

Method vertex

source/MRMesh/MRMeshLoad.cpp:427–436  ·  view source on GitHub ↗

floats in Vector3f must be 4-bytes aligned on some platforms, so we use chars and cast them in Vector3f on access

Source from the content-addressed store, hash-verified

425 char attrs[2];
426 // floats in Vector3f must be 4-bytes aligned on some platforms, so we use chars and cast them in Vector3f on access
427 Vector3f vertex( int i ) const
428 {
429 #if __cpp_lib_bit_cast >= 201806L
430 return std::bit_cast<Vector3f>( coords[i] );
431 #else
432 Vector3f v;
433 std::memcpy( &v, &coords[i], sizeof( coords[i] ) );
434 return v;
435 #endif
436 }
437 };
438 static_assert( sizeof( StlTriangle ) == 50 );
439 static_assert( alignof( StlTriangle ) <= 2 );

Callers 1

fromBinaryStlFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected