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

Method from_3_points failing when called with FullArc2D cls #1281

Open
1 of 2 tasks
GhislainJ opened this issue Feb 14, 2024 · 0 comments · Fixed by #1282
Open
1 of 2 tasks

Method from_3_points failing when called with FullArc2D cls #1281

GhislainJ opened this issue Feb 14, 2024 · 0 comments · Fixed by #1282

Comments

@GhislainJ
Copy link
Contributor

  • I'm submitting a ...
    • bug report
    • feature request

Status is high because it blocks the reference_path PR

  • What is the current behavior?

Given the following error :

image

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem Avoid reference to other packages
from volmdlr.edges import FullArc2D

p0 = Point2D(0, 0)
p1 = Point2D(0, 1)
p2 = Point2D(1, 1) 
a = FullArc2D.from_3_points(p0, p1, p2)
  • What is the expected behavior?

I unsure if this there is an expected behavior, but i guess this should not fail as it is covered by the test surfaces/test_cylindrical_surface3d.TestCylindricalSurface3D.test_contour3d_to_2d

  • What is the motivation / use case for changing the behavior?

This is problematic because the test failed when I added some argument to the init functions which misaligned the two signatures :

class Arc2D(ArcMixin, Edge):
    def __init__(self, circle: 'volmdlr.curves.Circle2D', start: volmdlr.Point2D, end: volmdlr.Point2D, reference_path: str = PATH_ROOT, name: str = ''):
class FullArc2D(FullArcMixin, Arc2D):
    def __init__(self, circle: 'volmdlr.curves.Circle2D', start_end: volmdlr.Point2D, reference_path: str = PATH_ROOT, name: str = ''):

The following call can have Arc2D or FullArc2D as cls :

arc = cls(circle, point1, point3, reference_path, name)

It means that before that, we were able to generate an Arc2D as well as a FullArc2D, but by giving respectively point1 to FullArc2D's start_end and point3 to reference_path.

I could make it work by removing either the reference_path or name argument (as it was done before), but this is plainly wrong

  • Possible fixes

Either override FullArc2D's method or prevent user from creating a FullArc2D from 3 points.
I am going to propose a fix with the former, here

  • Please tell us about your environment:

    • branch: dev
    • commit:
    • python version: 3.9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant