Comments (25)
@KeithSloan
COIN3D is a dead project, OCCT is kind a closed way (no fix is expected).. so no hopes there at least for now. I tried to find a way to inject OpenGL (modern) into COIN3D, but no .. it is not possible.
The only thing remained for me is try to bring Wings3D to freecad.
But the problem is Wings3D is written using a such horrible language that you cannot bring it so easy. And also is based on very old OpenGL.
I tried to use FLTK, I faced also a lot of problems. Wasn't easy. It is a rabbit hole.
I now try to make the conversion using ImGui.
Nothing is easy. Design456 based on OCCT and COIN3D is almost dead because of all difficulties I faced for direct modeling.
FreeCAD because of OCCT is veryyyyy sloooooow. And direct modeling is about quickly movements .. so that is not a good combination.
in short, no direct modeling is possible without using MESH and using OpenGL (modern) or Vulkan.
from gsoc.
I am Prakhar Srivastava a student if IIT Roorkee ,India and I would like to work on this issue can u tell what ide u suggest for this, or maybe the ide u would have worked on
from gsoc.
Warning: This project idea had been formulated for GSO2020, and might be too big for the new format of GSOC2021. Nevertheless, this functionality is still required, and this can serve as a base to build your own project, or could be implemented partially.
from gsoc.
Other FreeCAD ideas for 2021 at https://www.forum.freecadweb.org/viewtopic.php?f=8&t=54913
from gsoc.
FYI, there's work already going on for direct modeling in FreeCAD at https://github.com/MariwanJ/Design456
Maybe a student can join the effort ?
/cc @MariwanJ
from gsoc.
@yorik:
By parametric modeling : Do you mean that even Direct Modeling should have options, parameters that could be changed live to change the object you applied a command before?
Like what you have now in Sketcher?
In my understanding, direct modeling will not have any parametric, you apply a command and the object will follow that command .. that is it.
You might have some undo-redo but not more.
If you think to use parameter to change an object, that would create a huge problem for the project. It is like class-inheritance. if someone, or somehow the base-class changed .. the whole project might fail.
Please forgive my lack of knowledge. In all commands I am implementing, I make a simple copy of what I done. So no way to go back a step. I didn't implement yet undo-redo .. but there will be .. More than that will not be possible.
Biggest problem in FreeCAD at the moment for me .. Many object-parameters are read only. So you cannot easily modify them.
For example chaining location of a vertex will not be possible if you don't re-crate the object from new vertices . you need to recreate them to be able to change anything.
That is what the API tell me .. I might be wrong.
First thing to do in this project. Make tools (classes) to let developer use them. Tools that allow developer to modify shapes, vertices and objects. Documented in details.
Second thing to mention:
Should we stick to CPP or it is ok with python. I have a CPP background but started to use python since it was easier to start with FreeCAD API.
Unfortunately, There are so many developers out there that make a different functionalities, but but it is totally fragmented .
from gsoc.
You approach seems good too, it's mostly a question of deciding how one wants to do things. There is basically no right or wrong here I think. Indeed tying strictly to parametric model has drawbacks too (slower approach, maybe ends up in a "half-baked direct modeling"), But the current API can be extended too. Having "movable vertices" is possible too, look at the Draft Wire/polyline for example. It's just a matter of how you design things.
from gsoc.
Yorik:
You are an experience FreeCAD developer. Please answer my question regarding if I stick to CPP or Python?
I have a feeling that it would be difficult to make all these bases/changes using python .. at least it will be slow somehow.
from gsoc.
If you use cpp
and want people to test, then we'll need to figure out how to compile FC test builds for people to use. Most won't know how or not want to because of the amount of time it takes to compile FC.
from gsoc.
Please answer my question regarding if I stick to CPP or Python?
Basicallyit does not make big difference... It it more a question of your own preference, what you are most comfortable with. Almost anything can be done in either language. If you are thinking of doing this in a separate addon/workbench, though, then working in python is an advantage, as your code can be distributed "as is", no compiling/packaging necessary.
from gsoc.
In my opinion there is no need to touch the TopoShapes themselves. You would be reinventing the wheel, which is already well enough done by OpenCasCade.
I think this is mostly an UX job, not a geometry job. What we need is to think a system of how a person can interact with a shape (ex: move a vertex, move an edge, move a face, scale an edge, scale a face, rotate an edge, rotate a face, extrude/intrude a face, extrude several faces, move several vertices/edges/faces, cut through/divide a face, the list can be endless), and define UI tools that provide a nice UX experience to the user to perform these things. That is, define the steps of what the user does, what they see, what they can do next, etc. and implement the needed coin workflow (manipulable widgets, etc) That's 99% of the work. Recreating the object itself is 1% of the work (OK maybe I'm exaggerating a bit ;) ), and IMHO it's no big deal to have the tool recreating the object, and it's overkill to re-imagine a whole geometry system just for that, when we have a fairly good one already.
But of course all this is just my vision, basically it is how I would myself approach it. Any research is always a benefit, so pursuing another way is absolutely no wasted effort, if you are interested in doing it that way.
from gsoc.
This is still valid for GSOC 2022. One should have a look at other attempts and maybe joint forces:
- carlopav in https://forum.freecadweb.org/viewtopic.php?t=49837
- Design456 workbench in https://github.com/MariwanJ/Design456
This issue on FreeCAD: FreeCAD/FreeCAD#5764
from gsoc.
"What we need is to think a system of how a person can interact with a shape (ex: move a vertex, move an edge, move a face, scale an edge, scale a face, rotate an edge, rotate a face, extrude/intrude a face, extrude several faces, move several vertices/edges/faces, cut through/divide a face, the list can be endless)"
Given that this project is defined as Hard and the above long list of interactions, how about starting with a sub project namely interacting with Part2DObjects https://wiki.freecadweb.org/Part_Part2DObject
Once the foundations of interacting with 2D objects is established then things can then progress in the fullness of time onto the full gambit of Shapes and the multitude of possible interactions
i.e Initial phase add support in FreeCAD for
-
Selecting
* The ends of lines * lines / curves * Control points
-
Moving selection
-
Updating Part2Object info
Then could update the Curves part of the Curves workbench to have editable curves, this could be done without the need to recompile FC.
A follow on step could be Surfaces following a similar approach.
I feel the above would make for a more containable project with a useful end point
from gsoc.
@KeithSloan
This is not anything bad for what you wrote or against anything/one, but it is the reality of FreeCAD. This is MHO.
It is easy to describe what we should do for making direct modeling achieved. But the reality is the OCC is not capable to do so. It is very slow, and full of bugs.
I made several tools and those tools are suffering from the slowness of the OCC and FreeCAD.
Several times I described how we can try to introduce other things to FreeCAD but the freecad community are not interested in direct modeling.
Alone, I was trying to talk the forum for finding other way of thinking.. the result is nothing.
So, it is not possible to make what you described simply because freecad cannot do direct change in objects due to the internal structure for both freecad and OCC.
If you read about 3D Wings you understand the principle used there to achieve the direct modeling they have.
For every little change you do in freecad, you have to redraw the whole thing. In normal Windows/X server GUI , often you have to limit the area you are redrawing/recalculating. That is not possible for OCC or FreeCAD.
I have a test that I just collect some 3D models in a Fusion object. It becomes so slow after some 30 pcs that is not responsive any more as it should... only a Fusion nothing complicated. I have a video about that.
Without real change in the way FreeCAD made, real direct modeling is no just hard, it is impossible.
Look at and use my tools and my videos, you will see the difficulties.
It is almost a year I am trying to work on this project, still I am along .. no one wish to come to the project.
hope I answered your comment.
Google summer will results in nothing to be honest.
from gsoc.
@MariwanJ I have in the past had a brief look at your Design456 Workbench. I think it is brave attempt at Direct modelling but I am not sure your about your approach of trying to enable manipulation via OCC.
@yorikvanhavre Makes second item in details is "Get familiar with Coin, FreeCADs 3D display manager, and understand how to create manipulators and interact with the 3D scene" i.e Looking at implementing Coin facilities to enable manipulation.
Some time ago I added an issue to the Curves workbench seehttps://github.com/tomate44/CurvesWB/issues/59
asking for the ability to edit curves the response "Making the interactive feature is not an easy task with Pivy.
@joelgraff made the pivy_trackers library that looks great. I did a couple of tests but was not able to use it properly, unfortunately."
I think Joels tracker is used in the Civil Engineering workbench Trails perhaps @joelgraff and @HakanSeven12 could comment.
@MariwanJ "It is almost a year I am trying to work on this project, still I am alone .. no one wish to come to the project.
hope I answered your comment. Google summer will results in nothing to be honest."
Which re-enforces my view that this needs to be tackled as a small subset, my suggestion being just manipulation Part2DObjects.
SMALL STEPS and SMALL BEGINNINGS
from gsoc.
pivy_trackers works, but it's a bit complicated. And I've just not had time to really work on it lately. That said, I have managed to make it work as a real-time curve adjustment tool for horizontal highway alignments in Trails. Python is just good enough as a scripting language to keep up with the demands, but I think I'm really pushing the limits, here - it really ought to be compiled.
My goal was to create a visualization framework to prototype engineering tools - a way to provide immediate visual feedback during engineering design processes, rather than adjusting parameters, applying changes, and watching to see how the geometry updates. If there's interest in implementing it in a specific context, I'm open to that, but I don't promise it'll be quick or easy.
from gsoc.
Regarding coin, I made many detailed steps how to use it and I have the widget system FR_WIDGET. But I don't like the idea to use coin. That makes my code too complex with a gain of nothing. You wouldn't be able to replace OCC as you need to redraw the shape each time you change the (face, vertex, edge) .. just not possible. For very basic shape, I managed to replace OCC with coin .. but that is far from being used properly .. and works only on planer shapes.
Newer 3d library is essential and a better way of representing objects in 3D world is also a MUST.
I described my idea at the forum .. no one replied that post and for that reason .. there is no way to do that thing by a person.
You have to take that idea.. you shouldn't redraw the whole screen because of a change that is made on one object. If you are careful in looking at other CAD program (for example DesignSpark Mechanical) you will notice that internally they keep the (cylinder, box, ..etc) as it is .. but they draw the results not the primitive objects. As soon as you click the object, they draw the basic shape behind that part or face.
Any external library will fail since FreeCAD will "never" included and your project will not reach users. That is why I am kinda rejecting including other library without been added to FreeCAD core.
from gsoc.
Question - With a Sketch I can create a BSpline and I can edit it by pressing the Ctrl key and selecting a Control point which I can drag around and the curve changes in realtime. Okay this is 2D but how is the Sketcher workbench implementing this?
from gsoc.
Each time, it must recreate the whole thing. There is no other way to do so. Think if you have hundred of objects, and OCC is slow?
it wouldn't work.
from gsoc.
Well it does not appear to redraw the other lines in the sketch, just the BSpline being manipulated.
from gsoc.
An aside,@realthunder was talking about Coin3D in foss4g. I don't recall if it was for replacing or augmenting the coin3d library? Perhaps he can weigh-in?
from gsoc.
It is to augment Coin3D. I'd like to keep the node construction and iteration part of Coin3D, but replace its rendering backend with some third party library. The current design of Coin3D rendering backend is too tightly coupled with the rest. I managed to use its SoCallback interface to replace its render caching entirely and perform rendering with my own code. Although the rendering is done using only OpenGL 2 which is more or less the same as Coin3D, there is already big performance gain for large assembly.
The most critical part for improving the rendering performance is actually the rendering cache. In CAD particularly, where the assets are dynamically created and prone to changes. The cache must be able to reuse as much as possible but can still perform incremental update efficiently. Using third part library makes it easy to leverage on modern graphics API. Apart from giving us more eye candy, ultimately, for a CAD system, it is to help improve caching, like instance rendering, etc.
OCC boolean operation is no doubt slow in non trivial cases, but we can work around it by showing partial result. Like what I've done with PartDesign right now, for almost all features, you can preview only the tool shape while editing instead of the final shape. We can even explore possibility to run OCC and rendering in different CPU cores.
BTW, I am very much interested in direct modeling. But I think the rendering part is more important at the moment, which is what I'd like to work on first. Actually, there are two not quite related aspect of direct modeling, one is the push pull UI, and the other is the much more difficult feature-less/history-less direct shape manipulation like those in Fusion 360 and SolidEdge. I'm assuming we are talking about the first aspect right now, although I'm interested in both.
from gsoc.
I'm not really involved in FreeCAD, but I feel the urge to comment as well:
Even if it turns out direct modelling on top of OCCT is slow for interactive use. There might be cases where it might still make sense in programmatic use. For example. I'd like to have the option to snap the second operand geometry onto the geometry of the first operand prior to performing a boolean operation (giving more local control, as an alternative to the global fuzziness). I can imagine that out of this project a good API originates that could be used for that purpose. Like ShapeBuild_ReShape
but with a more geometric focus.
Yes, OCCT can be slow, but it might be that certain bottlenecks can be eliminated with caching or a more efficient higher level data model (Maybe Part already provides some of that, sorry I don't know). For example, for calls like OuterWire
one might naively assume it's like a constant time operation that just reads a flag or something. Where in fact it does a full geometric check for containment of a point infinitely far away for every wire in the face. If the bottlenecks are known I think that with an intermediate data structure on top of TopoDS it may be possible to provide a more efficient and more user friendly API for this purpose. Same for ancestor and sibling lookup, they can probably be stored directly and with the assumption of a manifold valid data structure certain shortcuts can be made in terms of retrieval.
from gsoc.
I think @MariwanJ is in danger of throwing out the baby with the bath water. I see Wings3D in the same category as Rhino https://www.rhino3d.com and to a certain degree Blender. If the only way to achieve direct modeling is a root and branch redesign of FreeCAD then maybe people should be puting their efforts into enhancing Blender, Wings3D. I think @yorikvanhavre has developed a FreeCAD importer for Blender(?)
from gsoc.
FreeCAD is now participating as their own GSoC org, congrats!
from gsoc.
Related Issues (20)
- LibreCAD 3 automatic releases HOT 2
- Port LibreCAD 2 tools to LibreCAD 3
- Improve FreeCAD's OpenSCAD importer handling of Hull Requests HOT 1
- Improve FreeCAD - OpenSCAD interaction HOT 1
- Implement BIM/IFC geometry for infrastructure assets
- appleseed physically-based renderer release infrastructure HOT 3
- Implement AP242 STEP geometry importer for BRL-CAD
- Integrate STEPcode into IfcOpenShell
- Continuation of a prior BRL-CAD GSoC effort HOT 3
- Improving FreeCAD Headless mode
- Improve FreeCAD Hidden Line Removal HOT 7
- Robust CSG Boolean Evaluation (a.k.a. Robust Facetization for Geometry Export) HOT 7
- Physically-Based Rendering (PBR) advanced shaders
- Interface to interact with Brickschema HOT 4
- Interface to easily create glTF compatible materials for IFC objects HOT 8
- GSoC 2023: On-Machine Inspection project has a broken link HOT 1
- Update Appleseed to Python3 HOT 8
- KiCad to ODB++ exporter HOT 4
- Create a new KiCad Importer HOT 3
- Electronic Simulation Application HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gsoc.