Skip to content

Commit

Permalink
Add API for Modeling Ply geometry export (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
greschd authored Jul 3, 2024
1 parent bcb342f commit 0bef076
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ repos:
hooks:
- id: add-license-headers
args:
- --start_year=2022
- --start_year=2022
2 changes: 1 addition & 1 deletion src/ansys/api/acp/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0.dev8
0.1.0.dev9
13 changes: 13 additions & 0 deletions src/ansys/api/acp/v0/enum_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,16 @@ enum BooleanOperationType {
ADD = 1;
REMOVE = 2;
}

enum OffsetType {
NO_OFFSET = 0;
BOTTOM_OFFSET = 1;
MIDDLE_OFFSET = 2;
TOP_OFFSET = 3;
}

enum ArrowType {
NO_ARROW = 0;
HALF_ARROW = 1;
STANDARD_ARROW = 2;
}
2 changes: 2 additions & 0 deletions src/ansys/api/acp/v0/material.proto
Original file line number Diff line number Diff line change
Expand Up @@ -286,5 +286,7 @@ service ObjectService {

rpc Create(CreateRequest) returns (ObjectInfo);

// Custom methods

rpc SaveToFile(SaveToFileRequest) returns (base.Empty);
}
6 changes: 6 additions & 0 deletions src/ansys/api/acp/v0/modeling_ply.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import "ansys/api/acp/v0/enum_types.proto";
import "ansys/api/acp/v0/array_types.proto";
import "ansys/api/acp/v0/ply_material.proto";
import "ansys/api/acp/v0/linked_selection_rule.proto";
import "ansys/api/acp/v0/ply_geometry_export.proto";

enum ThicknessType {
NOMINAL = 0;
Expand Down Expand Up @@ -101,4 +102,9 @@ service ObjectService {
rpc Delete(base.DeleteRequest) returns (base.Empty);

rpc Create(CreateRequest) returns (ObjectInfo);

// Custom methods

rpc ExportGeometries(ply_geometry_export.ExportGeometriesRequest)
returns (base.Empty);
}
50 changes: 50 additions & 0 deletions src/ansys/api/acp/v0/ply_geometry_export.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
// SPDX-License-Identifier: MIT
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

syntax = "proto3";
package ansys.api.acp.v0.ply_geometry_export;

import "ansys/api/acp/v0/base.proto";
import "ansys/api/acp/v0/enum_types.proto";

enum ExportFormat {
STEP = 0;
IGES = 1;
STL = 2;
}

message ExportOptions {
ExportFormat format = 1;
enum_types.OffsetType offset_type = 2;
bool include_boundary = 3;
bool include_surface = 4;
bool include_first_material_direction = 5;
bool include_second_material_direction = 6;
double arrow_length = 7;
enum_types.ArrowType arrow_type = 8;
}

message ExportGeometriesRequest {
string path = 1;
repeated base.ResourcePath plies = 2;
ExportOptions options = 3;
}
10 changes: 5 additions & 5 deletions src/ansys/api/acp/v0/solid_model.proto
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ message DropOffSettings {

message ExportSettings {
bool use_default_section_index = 1;
int32 section_index = 2;
int64 section_index = 2;
bool use_default_coordinate_system_index = 3;
int32 coordinate_system_index = 4;
int64 coordinate_system_index = 4;
bool use_default_material_index = 5;
int32 material_index = 6;
int64 material_index = 6;
bool use_default_node_index = 7;
int32 node_index = 8;
int64 node_index = 8;
bool use_default_element_index = 9;
int32 element_index = 10;
int64 element_index = 10;
bool use_solsh_elements = 11;
bool write_degenerated_elements = 12;
bool drop_hanging_nodes = 13;
Expand Down

0 comments on commit 0bef076

Please sign in to comment.