Skip to content

Conversation

@RobPasMue
Copy link
Member

Closes #117

This will allow to do the following (from PyAnsys Geometry, for example):

from ansys.geometry.core import launch_modeler
from ansys.geometry.core.math import Point2D
from ansys.geometry.core.misc import UNITS
from ansys.geometry.core.sketch import Sketch

modeler = launch_modeler(mode="docker")

design = modeler.create_design("my_design")

# Create a sketch of a box
sketch_box = Sketch().box(Point2D([0, 0], unit=UNITS.m), width=30 * UNITS.m, height=40 * UNITS.m)

# Create a sketch of a circle (overlapping the box slightly)
sketch_circle = Sketch().circle(Point2D([20, 0], unit=UNITS.m), radius=3 * UNITS.m)

# Extrude both sketches to get a prism and a cylinder
prism = design.extrude_sketch("Prism", sketch_box, 50 * UNITS.m)
cylin = design.extrude_sketch("Cylinder", sketch_circle, 50 * UNITS.m)

# Design plotting
design.plot(multi_colors=True)

# Close the modeler
modeler.close()

image

@RobPasMue RobPasMue self-assigned this Jul 31, 2024
@RobPasMue
Copy link
Member Author

This will require a new release

@github-actions github-actions bot added the enhancement New features or code improvements label Jul 31, 2024
Copy link
Collaborator

@AlejandroFernandezLuces AlejandroFernandezLuces left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for this implementation 🙂

I can release once this is merged.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 60.46%. Comparing base (d87f747) to head (1665d4d).

Files Patch % Lines
...on_interface/backends/pyvista/pyvista_interface.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #118   +/-   ##
=======================================
  Coverage   60.46%   60.46%           
=======================================
  Files          24       24           
  Lines         817      817           
=======================================
  Hits          494      494           
  Misses        323      323           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@RobPasMue RobPasMue merged commit f12e515 into main Jul 31, 2024
@RobPasMue RobPasMue deleted the feat/multi-colors branch July 31, 2024 12:00
@RobPasMue
Copy link
Member Author

Feel free to release @AlejandroFernandezLuces

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New features or code improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhance Plotting Functionality to Differentiate Bodies by Color

5 participants