Skip to content

Translate only works for bodies/components #1945

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

Open
2 tasks done
syscordan opened this issue Apr 30, 2025 · 0 comments
Open
2 tasks done

Translate only works for bodies/components #1945

syscordan opened this issue Apr 30, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@syscordan
Copy link
Contributor

🔍 Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

🐞 Description of the bug

There is a translate for the bodies and components (ie body.translate) but none for faces or edges. Faces or edges can be moved using move_translate but that only takes name selections as the argument. It

📝 Steps to reproduce

design = modeler.create_design("move_rotate_box")
body = design.extrude_sketch("box", Sketch().box(Point2D([0, 0]), 2, 2), 2)
ns = design.create_named_selection("Five", faces=[design.bodies[0].faces[1]])
ns1 = design.create_named_selection("New", edges=[design.bodies[0].edges[4], design.bodies[0].edges[0], design.bodies[0].edges[6], design.bodies[0].edges[2]])
ns2 = design.create_named_selection("Weekend", bodies=[design.bodies[0]])
success = modeler.geometry_commands.move_translate(ns2, UNITVECTOR3D_Z, Distance(0.2, UNITS.m))
body.translate(UnitVector3D([1, 0, 0]), Quantity(4, UNITS.m))

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

No response

🐍 Which Python version are you using?

3.12

📦 Installed packages

import os
import sys
import math
import numpy as np
from pint import Quantity
from pyvista.plotting import system_supports_plotting
from ansys.geometry.core import *
from ansys.geometry.core.connection import *
from ansys.geometry.core.designer import *
from ansys.geometry.core.materials import *
from ansys.geometry.core.math import *
from ansys.geometry.core.misc import *
from ansys.geometry.core.misc.units import UNITS
from ansys.geometry.core.plotting import *
from ansys.geometry.core.sketch import *
import pytest
from ansys.geometry.core.shapes.curves.line import Line
@syscordan syscordan added the bug Something isn't working label Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant