Rigid body parameters of closed surface meshes

버전 1.5.0.2 (864 KB) 작성자: Anton Semechko
Fast computation of exact rigid body parameters of closed triangular surface meshes using divergence theorem
다운로드 수: 761
업데이트 날짜: 2021/9/24

Rigid Body Parameters

View Rigid body parameters of closed surface meshes on File Exchange

In order to simulate dynamic behaviour of a rigid-body, one requires knowledge of a set of rigid-body parameters such as the total mass of the rigid-body, the center of mass, as well as the moments and products of inertia. The purpose of this submission is to provide a function which computes exact rigid-body parameters of objects represented by closed, triangular surface meshes. The principles underlying the calculations are based on the divergence theorem and are explained in detail in the attached .pdf document. This submission also includes two functions that take as input an arbitrary mesh and output parameters of a primitive object, such as an ellipsoid or a cuboid, with exactly the same inertial parameters as the input object. Finally, VisualizeLocaFrame.m function can be used for visualizing local frames of reference constructed from principal axes of inertia.

Quick Demo

load('sample_mesh') 	
RBP=RigidBodyParams(TR);
disp(RBP)
VisualizeLocalFrame(TR)

Enforcing Consistent and Proper Face Orientation

All calculations are based on the assumption that the input mesh is closed, manifold, and has outward pointing normals. To obtain outward point normals, the vertices of all faces must have counterclockwise ordering. If you know or suspect the input the mesh has either inconsistent or improper face orientation use function ConsistentNormalOrientation prior to computing the rigid-body parameters. Here is an example:

load('sample_mesh')
[F,V]=GetMeshData(TR);

% Randomly mix-up orientations of the faces to simulate the problem above
Nf=size(F,1);
idx=randn(Nf,1)>0;	
F2=F;
F2(idx,:)=fliplr(F(idx,:));
TR2=triangulation(F2,V);
fprintf('\nNumber of inverted faces: %d\n',nnz(idx))
	
% Enforce proper face orientation
[TR2_fix,cnt]=ConsistentNormalOrientation(TR2);
fprintf('Number of faces corrected: %d\n\n',cnt)

% Verify that the output is identical to RBP for the original mesh
RBP_fix=RigidBodyParams(TR2_fix);

fprintf('Corrected mesh:\n')
disp(RBP_fix)

fprintf('Original (reference) mesh:\n')
disp(RigidBodyParams(TR))

% Result you would have gotten without ensuring proper face orientation:
RBP2=RigidBodyParams(TR2);
fprintf('Uncorrected mesh:\n')
disp(RBP2)

License

MIT © 2019 Anton Semechko a.semechko@gmail.com

인용 양식

Anton Semechko (2024). Rigid body parameters of closed surface meshes (https://github.com/AntonSemechko/Rigid-Body-Parameters), GitHub. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2013a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Inertias and Loads에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

GitHub 디폴트 브랜치를 사용하는 버전은 다운로드할 수 없음

버전 게시됨 릴리스 정보
1.5.0.2

Use README.md from GitHub

1.5.0.1

Add 'ConsitentNormalOrientation.m' to ensure consistent and proper face normal orientation.

1.4.0.1

- submission description update

1.4.0.0

- migrated to GitHub

1.3.0.0

- no changes were made

1.2.0.0

Forgot to include a number of auxiliary functions used during visualization. This submission contains all of the necessary functions.

1.1.0.0

- Made corrections to the attached document explaining the calculations implemented in this submission.
- Added a function to help visualize local frame of reference constructed from principal axes of inertia

1.0.0.0

이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.
이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.