Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added polyline simplification to import_odb_archive and import_ipc2581_archive #212

Merged
merged 10 commits into from
Jan 17, 2024
31 changes: 30 additions & 1 deletion src/ansys/sherlock/core/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ def import_odb_archive(
ims_stackup=False,
project=None,
cca_name=None,
polyline_simplification=False,
polyline_tolerance=0.1,
polyline_tolerance_units="mm",
):
"""Import an ODB++ archive file.

Expand All @@ -110,6 +113,12 @@ def import_odb_archive(
cca_name : str, optional
Name of the CCA name. The default is ``None``, in which case the
name of the ODB++ archive file is used for the CCA name.
polyline_simplification: bool, optional
Whether to enable polyline simplification
polyline_tolerance: float, optional
Polyline simplification tolerance
polyline_tolerance_units: str, optional
Polyline simplification tolerance units

Returns
-------
Expand Down Expand Up @@ -151,6 +160,9 @@ def import_odb_archive(
imsStackup=ims_stackup,
project=project,
ccaName=cca_name,
polylineSimplification=polyline_simplification,
polylineTolerance=polyline_tolerance,
polylineToleranceUnits=polyline_tolerance_units,
)

response = self.stub.importODBArchive(request)
Expand All @@ -166,7 +178,15 @@ def import_odb_archive(
raise e

def import_ipc2581_archive(
self, archive_file, include_other_layers, guess_part_properties, project=None, cca_name=None
self,
archive_file,
include_other_layers,
guess_part_properties,
project=None,
cca_name=None,
polyline_simplification=False,
polyline_tolerance=0.1,
polyline_tolerance_units="mm",
):
"""Import an IPC-2581 archive file.

Expand All @@ -184,6 +204,12 @@ def import_ipc2581_archive(
cca_name : str, optional
Name of the CCA. The default is ``None``, in which case the name of
the IPC-2581 archive file is used for the CCA name.
polyline_simplification: bool, optional
Whether to enable polyline simplification
polyline_tolerance: float, optional
Polyline simplification tolerance
polyline_tolerance_units: str, optional
Polyline simplification tolerance units

Returns
-------
Expand Down Expand Up @@ -220,6 +246,9 @@ def import_ipc2581_archive(
guessPartProperties=guess_part_properties,
project=project,
ccaName=cca_name,
polylineSimplification=polyline_simplification,
polylineTolerance=polyline_tolerance,
polylineToleranceUnits=polyline_tolerance_units,
)

response = self.stub.importIPC2581Archive(request)
Expand Down
Loading