-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathassembly.proto
159 lines (140 loc) · 4.75 KB
/
assembly.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
syntax = "proto3";
package mirabuf;
option optimize_for = SPEED;
import "types.proto";
import "joint.proto";
import "material.proto";
import "signal.proto";
/**
* Assembly
* Base Design to be interacted with
* THIS IS THE CURRENT FILE EXPORTED
*/
message Assembly {
/// Basic information (name, Author, etc)
Info info = 1;
/// All of the data in the assembly
AssemblyData data = 2;
/// Can it be effected by the simulation dynamically
bool dynamic = 3;
/// Overall physical data of the assembly
PhysicalProperties physical_data = 4;
/// The Design hierarchy represented by Part Refs - The first object is a root container for all top level items
GraphContainer design_hierarchy = 5;
/// The Joint hierarchy for compound shapes
GraphContainer joint_hierarchy = 6;
/// The Transform in space currently
Transform transform = 7;
/// Optional thumbnail saved from Fusion 360 or scraped from previous configuration
Thumbnail thumbnail = 8;
}
/**
* Data used to construct the assembly
*/
message AssemblyData {
Parts parts = 1; /// Meshes and Design Objects
joint.Joints joints = 2; /// Joint Definition Set
material.Materials materials = 3; /// Appearance and Physical Material Set
signal.Signals signals = 4; // Contains table of all signals with ID reference
}
// Part file can be exported seperately in the future
message Parts {
/// Part name, version, GUID
Info info = 1;
/// Map of the Exported Part Definitions
map<string, PartDefinition> part_definitions = 2;
/// Map of the Exported Parts that make up the object
map<string, PartInstance> part_instances = 3;
/// other associated data that can be used
UserData user_data = 4; // end effector, wheel, etc
}
/**
* Part Definition
* Unique Definition of a part that can be replicated.
* Useful for keeping the object counter down in the scene.
*/
message PartDefinition {
/// Information about version - id - name
Info info = 1;
/// Physical data associated with Part
PhysicalProperties physical_data = 2;
/// Base Transform applied - Most Likely Identity Matrix
Transform base_transform = 3;
/// Mesh Bodies to populate part
repeated Body bodies = 4;
/// Optional value to state whether an object is a dynamic object in a static assembly - all children are also considered overriden
bool dynamic = 5;
/// Optional value for overriding the friction value 0-1
float friction_override = 6;
/// Optional value for overriding an indiviaul object's mass
float mass_override = 7;
}
/*
* Part
* Represents a object that does not have to be unique
* Can be an override for an existing definition
*/
message PartInstance {
Info info = 1;
/// Reference to the Part Definition defined in Assembly Data
string part_definition_reference = 2;
/// Overriding the object transform (moves the part from the def) - in design hierarchy context
Transform transform = 3;
/// Position transform from a global scope
Transform global_transform = 4;
/// Joints that interact with this element
repeated string joints = 5;
// Appearance Reference to link to `Materials->Appearance->Info->id`
string appearance = 6;
/// Physical Material Reference to link to `Materials->PhysicalMaterial->Info->id`
string physical_material = 7;
/// Flag that if enabled indicates we should skip generating a collider, defaults to FALSE or undefined
bool skip_collider = 8;
}
/*
* Body object
* Can contain a TriangleMesh or Collection of Faces.
* Must be unique in the context of the Assembly.
*/
message Body {
Info info = 1;
/// Reference to Part Definition
string part = 2;
/// Triangle Mesh for rendering
TriangleMesh triangle_mesh = 3;
string appearance_override = 4; /// Override Visual Appearance for the body
}
/**
* Traingle Mesh for Storing Display Mesh data
*
*/
message TriangleMesh {
Info info = 1;
/// Is this object a Plane ? (Does it have volume)
bool has_volume = 2;
/// Rendered Appearance properties referenced from Assembly Data
string material_reference = 3;
/// What kind of Mesh Data exists in this Triangle Mesh
oneof mesh_type {
Mesh mesh = 4; /// Stored as true types, inidicies, verts, uv
BinaryMesh bmesh = 5; /// Stored as binary data in bytes
}
}
/**
* Mesh Data stored as generic Data Structure
*
*/
message Mesh {
/// Tri Mesh Verts vec3
repeated float verts = 1;
/// Tri Mesh Normals vec3
repeated float normals = 2;
/// Tri Mesh uv Mapping vec2
repeated float uv = 3;
/// Tri Mesh indicies (Vert Map)
repeated int32 indices = 4;
}
/// Mesh used for more effective file transfers
message BinaryMesh {
bytes data = 1; /// BEWARE of ENDIANESS
}