FreeCAD / FreeCAD

This is the official source code of FreeCAD, a free and opensource multiplatform 3D parametric modeler.
https://www.freecad.org
Other
19.75k stars 4.05k forks source link

Sketcher: Can't join two arcs #13645

Open dancesWithMachines opened 6 months ago

dancesWithMachines commented 6 months ago

Is there an existing issue for this?

Problem description

Scenario:

  1. Create one half of the arc and constrain it.
  2. Add second arc using same point as center and join the "arms".

Expected results: Arcs are joined together, sketch is constrained.

Actual result: Cannot join the arcs.

Visual: ScreenRecording2024-04-25at18 16 33-ezgif com-video-to-gif-converter

Full version info

[code]
OS: macOS 14.4
Word size of FreeCAD: 64-bit
Version: 0.21.2.33771 (Git)
Build type: Release
Branch: (HEAD detached at 0.21.2)
Hash: b9bfa5c5507506e4515816414cd27f4851d00489
Python 3.10.13, Qt 5.15.8, Coin 4.0.0, Vtk 9.2.6, OCC 7.6.3
Locale: C/Default (C)
[/code]

Subproject(s) affected?

Sketcher

Anything else?

I believe this is a regression. Two arcs cannot be joined in FreeCad 21.0+. I verified this on 20.2 and it would be over-constrained but work.

Code of Conduct

maxwxyz commented 6 months ago

can you check if you have enabled the setting auto remove constraints and play with it on/off? Could you please also test this in the current dev version: https://github.com/FreeCAD/FreeCAD-Bundle/releases/tag/weekly-builds

dancesWithMachines commented 6 months ago

can you check if you have enabled the setting auto remove constraints and play with it on/off?

I had auto remove redundants enabled by default. I disabled it and now it behaves like this. On 21.2 I get over-constrain error like below. ScreenRecording2024-04-25at19 01 42-ezgif com-video-to-gif-converter

On 20.02 I initially get same error, but if I try to move the sketch it resolves. ScreenRecording2024-04-25at18 58 49-ezgif com-video-to-gif-converter

Could you please also test this in the current dev version: https://github.com/FreeCAD/FreeCAD-Bundle/releases/tag/weekly-builds

On newest dev-build (36958-2024-04-23 ) it just crashes and exits. ScreenRecording2024-04-25at19 17 45-ezgif com-video-to-gif-converter

Crash log from devbuild: freecad_crash.zip

maxwxyz commented 6 months ago

@PaddleStroke FYI

PaddleStroke commented 6 months ago

I know what is happening here. I have seen this kind of issue before. The problem is that coincidence is taking 2 dof and arcs have only 5 dof. So you make a coincidence first with the centers, that's 2 dof. Then try to make coincidence with both end point. So that's total 6 dof.

So the arc is over constrained. So the auto remove removes the last one.

So I don't know what to say. I agree that from a user perspective it's annoying and seems to be a bug. But it's actually not. Perhaps we could accommodate the code to handle this situations. But I don't know how hard that would be

On Thu, Apr 25, 2024, 20:49 Max Wilfinger @.***> wrote:

@PaddleStroke https://github.com/PaddleStroke FYI

— Reply to this email directly, view it on GitHub https://github.com/FreeCAD/FreeCAD/issues/13645#issuecomment-2077956365, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEYO6MLQR6L62DPFZAK6PADY7FF5LAVCNFSM6AAAAABGZHGM2OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZXHE2TMMZWGU . You are receiving this because you were mentioned.Message ID: @.***>

dancesWithMachines commented 6 months ago

In this particular scenario equal can be used to achieve same result, but this feels like workaround'ing. From logical point of view I don't see why joining two arcs would not work, it isn't intuitional. ScreenRecording2024-04-25at22 56 00-ezgif com-video-to-gif-converter ScreenRecording2024-04-25at22 56 43-ezgif com-video-to-gif-converter

dancesWithMachines commented 6 months ago

The scenario from this bug is very simple, but I originally come up from this. ScreenRecording2024-04-25at23 20 33-ezgif com-video-to-gif-converter Here the outcome is different, depending on what I do first.

PaddleStroke commented 6 months ago

I totally agree that this feels very much like a bug. I have argued that in the past. I'm just not sure how to solve it. Anyone know how other Cads are handling this situation?

Maybe we need to add an exceptions in the solver for coincidence constraints for cases where arcs have 3 coincidences. Something like :

if (arc has 3 coincidence)
      ignore one dof of center coincidence