-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from Matter-and-Form/feature/Import
Feature/import
- Loading branch information
Showing
4 changed files
with
202 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
syntax = "proto3"; | ||
|
||
import "MF/V3/Descriptors/Project.proto"; | ||
|
||
package MF.V3.Descriptors; | ||
|
||
// Import scan descriptor. | ||
message Import | ||
{ | ||
// Import error codes. | ||
enum Error | ||
{ | ||
// The error is unspecified. | ||
Unspecified = 0; | ||
|
||
// The file format is not supported. | ||
FileNotSupported = 1; | ||
|
||
// The file format is supported but cannot be read. | ||
CannotReadFile = 2; | ||
|
||
// The imported mesh has no faces. | ||
MeshIsEmpty = 3; | ||
|
||
// There is not enough filesystem memory to store the mesh. | ||
NotEnoughStorage = 4; | ||
} | ||
|
||
// A file that was successfully imported to the project. | ||
message Imported | ||
{ | ||
// The file name. | ||
string file = 1; | ||
} | ||
|
||
// A file that failed to be imported to the project. | ||
message Ignored | ||
{ | ||
// The file name. | ||
string file = 1; | ||
|
||
// The import error code. | ||
Error error = 2; | ||
} | ||
|
||
// The list of successfully imported files. | ||
repeated Imported imported = 1; | ||
|
||
// The list of ignored files. | ||
repeated Ignored ignored = 2; | ||
|
||
// The updated project group tree. | ||
Project.Group groups = 3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
syntax = "proto3"; | ||
|
||
package MF.V3.Settings; | ||
|
||
// Import mesh settings. | ||
message Import | ||
{ | ||
// Unit of imported mesh positions. | ||
enum Unit | ||
{ | ||
// Mesh positions in millimeters. | ||
Millimeter = 0; | ||
// Mesh positions in centimeters. | ||
Centimeter = 1; | ||
// Mesh positions in meters. | ||
Meter = 2; | ||
// Mesh positions in inches. | ||
Inch = 3; | ||
// Mesh positions in feet. | ||
Foot = 4; | ||
} | ||
|
||
// Optional name of the impored mesh. Ignored if the imported file is a zip archive, in which case the archive filenames are used. | ||
optional string name = 1; | ||
|
||
// Optional scale factor for mesh positions. Default is 1.0. | ||
optional double scale = 2; | ||
|
||
// Unit of imported mesh positions. Default is millimeters. Ignored if the scale is specified. | ||
optional Unit unit = 3; | ||
|
||
// If true the mesh is centered at the world origin. Default is true. | ||
optional bool center = 4; | ||
|
||
// Project group index in which to add the imported meshes. Default is 0 (root group). | ||
optional int32 groupIndex = 5; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
syntax = "proto3"; | ||
|
||
import "MF/V3/Task.proto"; | ||
import "MF/V3/Settings/Import.proto"; | ||
|
||
package MF.V3.Tasks; | ||
|
||
/** | ||
* Import a set of 3D meshes to the current open project. The meshes must be archived in a ZIP file. Supported formats are DAE, FBX, GLB, OBJ, PLY and STL. | ||
* | ||
* > Request example: | ||
* | ||
* ```json | ||
* { | ||
* "Task":{ | ||
* "Index":1, | ||
* "Type":"Import", | ||
* "Input":{"unit":"Inch"} | ||
* } | ||
* } | ||
* ``` | ||
* | ||
* > Buffer message from client. | ||
* | ||
* ```json | ||
* { | ||
* "Buffer":{ | ||
* "Index":0, | ||
* "Size":1052, | ||
* "Task":{ | ||
* "Index":1, | ||
* "Type":"Import", | ||
* "Input":{"unit":"Inch"} | ||
* } | ||
* } | ||
* } | ||
* ``` | ||
* | ||
* > Binary data transfer from client: The mesh zip file [1052 bytes]. | ||
* > Response example: | ||
* | ||
* ```json | ||
* { | ||
* "Task":{ | ||
* "Index":1, | ||
* "Type":"Import", | ||
* "Input":{"unit":"Inch"}, | ||
* "Output":{ | ||
* "groups":[{"index":1,"name":"box","scan":1}], | ||
* "imported":[{"file":"mesh.ply"}], | ||
* "ignored":[], | ||
* }, | ||
* "State":"Completed" | ||
* } | ||
* } | ||
* ``` | ||
*/ | ||
message Import | ||
{ | ||
|
||
// Client request for the `Import` task. | ||
message Request | ||
{ | ||
// A unique identifier generated by the client. | ||
int32 Index = 1; | ||
|
||
// "Import" | ||
string Type = 2; | ||
|
||
// Import settings. | ||
optional Settings.Import Input = 3; | ||
} | ||
|
||
// Server response for the `Import` task. | ||
message Response | ||
{ | ||
// The unique identifier generated by the client. | ||
int32 Index = 1; | ||
|
||
// "Import" | ||
string Type = 2; | ||
|
||
// Requested export settings. | ||
optional Settings.Import Input = 3; | ||
|
||
// The current state of the task. | ||
optional TaskState State = 4; | ||
|
||
// A string describing the error if the task has failed. | ||
optional string Error = 5; | ||
} | ||
|
||
// Client buffer message for the `Import` task. | ||
message Buffer | ||
{ | ||
// The zero-based index identifying the data buffer. | ||
int32 Index = 1; | ||
|
||
// The size of the incoming data buffer in bytes. | ||
uint64 Size = 2; | ||
|
||
// The requested Import task. | ||
Task Task = 3; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters