Skip to content

arc_from_start_end_and_radius #2074

Open
@RyanJWard

Description

@RyanJWard

🔍 Before submitting the issue

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

🐞 Description of the bug

It looks like there is a rounding error while checking the the distance from the start\end points to the arc center

📝 Steps to reproduce

If you run this code
sketch1 = Sketch(Plane(Point3D([0,0,0], UNITS.mm),direction_x=UnitVector3D([1,0,0]),direction_y=UnitVector3D([0,1,0])))
width = 7
sketch1.arc_from_start_end_and_radius(Point2D([width/2,0], UNITS.mm), Point2D([-width/2,0], UNITS.mm), Quantity(width/2, UNITS.mm))
We get an error: ValueError: The start and end points of the arc are not an equidistant from the center point.
If you try changing width a little it works:
sketch1 = Sketch(Plane(Point3D([0,0,0], UNITS.mm),direction_x=UnitVector3D([1,0,0]),direction_y=UnitVector3D([0,1,0])))
width = 7.0001
sketch1.arc_from_start_end_and_radius(Point2D([width/2,0], UNITS.mm), Point2D([-width/2,0], UNITS.mm), Quantity(width/2, UNITS.mm))

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

252

🐍 Which Python version are you using?

3.12

📦 Installed packages

import os
import csv
import sys
import math
from pathlib import Path
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 *
from ansys.geometry.core.plotting import *
from ansys.geometry.core.sketch import *
from ansys.geometry.core.shapes.curves.line import Line
import numpy as np
import random

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions