SolveSpace Logo SOLVESPACE -- parametric 2d/3d CAD
Examples
Tutorials
Features
Download
Reference
Technology
Library
Forum
Contact
USER FORUM

(you are viewing a thread; or go back to list of threads)

Contributing to Solvespace (by Offej Coso)
i would like to contribute, but i'm not sure where to start.

1) does Solvespace have Documentation outside the code ?
2) what reading material can you recommend to get a better grasp of the geometric computation used in Solvespace.
3) i'm interested specifically, in adding a Sweep cut/Extrude feature, i'm aware it's a complex problem but would like to dive into it and try my luck. (might be naive)

thanks
Offej
Mon Oct 19 2020, 08:20:12
(no subject) (by Paul)
Hello Offej,

There isn't a lot of documentation but I'd like to create more. There are several distinct parts of solvespace and only a few of them are important for new construction tools like you propose.

If you look at the discussions around some of the other NURBS issues you may get a feel for how it's put together (don't forget about the closed issues as well). There are 2 main areas of the code to study, one is in surface.cpp and surface.h. That's where NURBS surfaces and their trim curves are created. It's where I started learning the code.

The other big thing you're going to face is dealing with entities. You can read notes about what I learned while implementing Helix extrusions here:

https://github.com/solvespace/...per_docs/Solver_Transforms.txt

There is a very important distinction in solvespace between the "sketch entities" and the actual NURBS shells/surfaces. The user never interacts directly with NURBS curves or surfaces, only sketch entites. When you make an extrusion, new "sketch in 3d" entities are created that the user can drag or add constraints to, but those are distinct from the actual trim curves of the NURBS. As you drag entities, the NURBS shell for the group is recreated each frame.

New sketch groups are created in: Group:MenuGroup()
The new entites are created in: Group::Generate()
And the new NURBS in: Group::GenerateShellAndMesh()

So to create a new extrusion method you'll want to figure out how you want the new entities to behave and get that working. Once that's going ok you can add code to create the corresponding shell from the entity geometry (or group parameters). To see what I mean by how the entities behave, create an extrude or revolve and then in the text window check the box for "suppress this group's solid model" and drag around the entities alone. You might also notice that lathe groups create some circle entites, but revolve and helix don't create those. That's because there isn't currently a suitable arc or helical-arc to create.

I have a number of incomplete or obsolete experiments on some of my branches on github if you want to study the changes I tried for specific construction operations:

Frustum Extrude:
https://github.com/phkahler/solvespace/tree/frustum
It replaces CTRL-X (I think) with an extrusion that can be skewed and the "new end" resized.

Two attempts at creating mirror groups:
https://github.com/phkahler/solvespace/tree/mirror_groups
https://github.com/phkahler/solvespace/tree/new-mirror

And one try at creating generic 3D copy groups:
https://github.com/phkahler/solvespace/tree/copy-groups

That last one is the simplest because it does not involve creating a new "copy type" for entities, and it's also the most recent experiment so I had a better understanding of what I was doing. None of those ever made it into SolveSpace because I'm not happy with any of them - either the implementation or the way the entities behave interactively, or because they're not complete.

If by "Sweep cut/Extrude" you mean Extrude-along-a-path that would be open issue here:
https://github.com/solvespace/solvespace/issues/439

In my opinion (based on how I'd approach it) it is closely related to Mirror groups which is open issue 72. It's also the most challenging to start with, so I'd recommend simpler things first.

You are more than welcome to give some of this a try and I'm willing to help where I can, and so are a couple other people. Do some reading and ask more questions under an existing GitHub issue or create a new one if your new feature is different from the open ones. What you want to do is possible if a bit challenging.
Mon Oct 19 2020, 11:21:04
(no subject) (by Offej)
Thank you for this comment, it gives me some foothold to start reading up.
i might try to document while i do that so someone else can join us in this quest in the future.

i will post on github when i will have something new to ask.
right now i have my work cut out for me.
Tue Oct 20 2020, 05:29:25
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):
© 2008-2022 SolveSpace contributors. Most recent update June 2 2022.