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

Deleting a workplane with an arc locked to it crashes SolveSpace #628

Closed
johreh opened this issue Jun 6, 2020 · 7 comments
Closed

Deleting a workplane with an arc locked to it crashes SolveSpace #628

johreh opened this issue Jun 6, 2020 · 7 comments
Labels

Comments

@johreh
Copy link
Contributor

johreh commented Jun 6, 2020

System information

SolveSpace version: 3.0~225f82a2

Operating system: Arch

Actual behavior

After constructing a new workplane inside an existing group and constructing an arc on that workplane, SolveSpace crashes when deleting the workplane.

Additional information

Example file with conditions already set up. Deleting r0004-workplane crashes SolveSpace.
workplane_arc.zip

@whitequark whitequark added the bug label Jun 6, 2020
@phkahler
Copy link
Member

phkahler commented Jun 10, 2020

@johreh I can reproduce the crash, but I can not figure out how you created that file. If I use Sketch->Workplane to create a new workplane it says I need to start a new sketch-in-3d first. If I create a sketch-in-3d first, I get a new group in the text window and can then add a new workplane. Your file does not have a sketch-in-3d group. What were the steps used to create that file?

@ruevs
Copy link
Member

ruevs commented Jun 10, 2020

It is easy:

  • Ctrl+N
  • 3 ("Sketch | Anywhere in 3d")
  • Rotate view with middle button drag
  • "Sketch | Workplane"
  • Click on origin to create the workplane
  • Select the created "workplane"
  • 2 ("Sketch | In Workplane")
  • A ("Sketch | Ark of a Circle")
  • Make an ark

Done. Now delete the workplane:

  • ESC
  • Click g002-sketch-in-plane
  • Click r004-wokplane1
  • Del

Crash.

It's a stack overflow in (the recursive) SolveSpaceUI::GenerateAll but I have not had time to debug it. Probably it is caused by the ark remaining an "orphan" when the workplane it is located in is deleted, but how exactly?...

Call stack:

>	solvespace.exe!malloc(unsigned int size) Line 23	C++
 	[External Code]	
 	solvespace.exe!SolveSpace::IdList<SolveSpace::Entity,SolveSpace::hEntity>::Add(SolveSpace::Entity * t) Line 424	C++
 	solvespace.exe!SolveSpace::Group::Generate(SolveSpace::IdList<SolveSpace::Entity,SolveSpace::hEntity> * entity, SolveSpace::IdList<SolveSpace::Param,SolveSpace::hParam> * param) Line 471	C++
 	solvespace.exe!SolveSpace::SolveSpaceUI::GenerateAll(SolveSpace::SolveSpaceUI::Generate type, bool andFindFree, bool genForBBox) Line 243	C++
 	solvespace.exe!SolveSpace::SolveSpaceUI::GenerateAll(SolveSpace::SolveSpaceUI::Generate type, bool andFindFree, bool genForBBox) Line 383	C++
[skip 2174 more recursive calls like this]
 	solvespace.exe!SolveSpace::SolveSpaceUI::GenerateAll(SolveSpace::SolveSpaceUI::Generate type, bool andFindFree, bool genForBBox) Line 383	C++
 	solvespace.exe!SolveSpace::SolveSpaceUI::GenerateAll(SolveSpace::SolveSpaceUI::Generate type, bool andFindFree, bool genForBBox) Line 197	C++
 	solvespace.exe!SolveSpace::GraphicsWindow::DeleteTaggedRequests() Line 976	C++
 	solvespace.exe!SolveSpace::GraphicsWindow::DeleteSelection() Line 70	C++
 	solvespace.exe!SolveSpace::GraphicsWindow::MenuClipboard(SolveSpace::Command id) Line 322	C++
 	solvespace.exe!SolveSpace::GraphicsWindow::ActivateCommand(SolveSpace::Command cmd) Line 198	C++
 	solvespace.exe!SolveSpace::GraphicsWindow::KeyboardEvent(SolveSpace::Platform::KeyboardEvent event) Line 258	C++
 	[External Code]	
 	solvespace.exe!SolveSpace::Platform::WindowImplWin32::WndProc(HWND__ * h, unsigned int msg, unsigned int wParam, long lParam) Line 990	C++
 	[External Code]	
 	user32.dll![Frames below may be incorrect and/or missing, no symbols loaded for user32.dll]	Unknown
 	solvespace.exe!SolveSpace::PolylineBuilder::GenerateEdges(SolveSpace::SEdgeList * sel) Line 220	C++
 	[External Code]	

@ruevs
Copy link
Member

ruevs commented Jun 10, 2020

NonCoplanarCirclesInOneWorkplaneExtruded.zip

By the way using this "technique" one can create rather "interesting" (nasty) Solvespace files. See for example the attached one. It has two circles in the first group but they are not co-planar. One is in the "XY" ("sketch-in-plane") and the other is in "workplane". When you extrude this group... it does not quite work, but is is interesting :-)

I have never reported this, because I consider it a "feature" (and not a "bug"). For example imagine solving math problems in geometry - which Solvespace is great for even though it may not have been designed with this in mind. Also try adding constraints - e.g. a distance between the two centers - it can be added as a 3D constraint or as a 2D projected one in any of the workplanes . This is GREAT (always has been)!

One more "trick": the extrude can be created with either workplane "active" and it is generated perpendicular to it. In this way it has always been (?) possible to create slanted extrusions:

SlantedExtrusion.zip

SlantedExtrusion

@phkahler
Copy link
Member

@ruevs I knew you could lathe around an axis not in the sketch plane, but I was not aware that skewed extrusions could be done! BTW, skewed extrusions should perform better in booleans since all the changes for non-orthogonal U,V derivatives. So much for issue #453 :-)

@ruevs
Copy link
Member

ruevs commented Jun 11, 2020

Interesting how that slipped past me, maybe I was somewhere without internet access :-)
I added a comment explaining how to do slanted extrusions in #453 so that anyone searching can find it.

By the way I do not think that this feature is documented. @whitequark - maybe we should add it to the documentation for 3.0.

I discovered it maybe 8-9-10(?) years ago when I had just discovered Sovespace and was amazed at how good it was and played a lot with all possible features. (Yes, I have been following "this" since the time when @jwesthues only had SketchFlat http://cq.cx/sketchflat.pl :-)

@ruevs
Copy link
Member

ruevs commented Jun 11, 2020

It is documented "a bit" #453 (comment). So we should update the reference manual https://github.com/solvespace/solvespace-web/blob/master/ref.pl

@whitequark
Copy link
Contributor

Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants