Starting parts

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Starting parts

Postby NormandC » Tue Jul 02, 2013 2:17 am

jcc242 wrote:Ah, I obviously hadn't done any research. I didn't know other clones existed or stl viewers and stuff.
Please ask him of his progress anyway. I'm interested in this, because the two I've linked are not open source. The closest one to Thingiverse is http://youmagine.com but it is not as seamless as Thingiverse, and it is not publicized so no one knows about it. It seems to be made by the Ultimaker people.
User avatar
rockn
Posts: 1516
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

Re: Starting parts

Postby rockn » Tue Jul 02, 2013 11:45 am

Hi Yorik,
I have a problem to push my parts to the github.

Code: Select all

jo@jo-desktop:~/FreeCAD/Dev/FreeCAD-library$ git push origin master
Username for 'https://github.com': wood-galaxy
Password for 'https://wood-galaxy@github.com': 
error: The requested URL returned error: 403 while accessing https://github.com/yorikvanhavre/FreeCAD-library.git/info/refs
fatal: HTTP request failed
What I did :
I cloned your repo.

Code: Select all

git clone https://github.com/yorikvanhavre/FreeCAD-library.git
I added my files.

Code: Select all

git add .
git pull
git commit -a
.git/COMMIT_EDITMSG
    Add Ironsmith/pied_poteau_100 (fcstd, brep, step, stl)
    # Please enter the commit message for your changes. Lines starting
    # with ‘#’ will be ignored, and an empty message aborts the commit.
    # On branch master
    # Changes to be committed:
    # (use « git reset HEAD … » to unstage)
    #
    # new file: Ironsmith/Brep/pied_poteau_100.brep
    # new file: Ironsmith/FCstd/pied_poteau_100.fcstd
    # new file: Ironsmith/Step/pied_poteau_100.step
    # new file: Ironsmith/Stl/pied_poteau_100.stl
    # 
And the push command causes the error above.
What did I do wrong ?
Formations et tutoriels FreeCAD en Français, soutenez moi : https://www.tipeee.com/formations-freecad
User avatar
shoogen
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Starting parts

Postby shoogen » Tue Jul 02, 2013 1:31 pm

i would suggest to push using the ssh protocol.
User avatar
yorik
Site Admin
Posts: 11163
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Starting parts

Postby yorik » Tue Jul 02, 2013 3:26 pm

Yes you can try with ssh (on the github page you can get ssh url instead of the https one. I'm not totally sure what's the difference... In any case, I used the ssh version here and all works ok.
But wood-galaxy is your github username? I only authorized user "rockn", that might be the cause...
Another thing, once you did "git clone", git already knows what is the URL to push. So you can just do "git push" after that...

BTW, I just added a first part, with a fcstd file, a step file, and an stl version, and miracle! github has an stl viewer, have a look! (You must have a webgl-enabled browser)
User avatar
shoogen
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Starting parts

Postby shoogen » Tue Jul 02, 2013 4:05 pm

yorikvanhavre wrote:Another thing, once you did "git clone", git already knows what is the URL to push. So you can just do "git push" after that...
This is not necessarily the case. If you cloned from a 'public' URL, the push will fail.
User avatar
jriegel
Site Admin
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Starting parts

Postby jriegel » Tue Jul 02, 2013 4:43 pm

Hi guys.

I did some time ago some research in version control systems for CAD. I also did some tests.

Unfortunately non of the big ones is really suited to CAD data...

Git relays mostly on its fast branching and merging and save there fore each file version as-is in its repository. There fore with every version of the file you have basically a copy with the same memory footprint. The compression of the object tree does no good, since our data a normally compressed already.
But the biggest problem is the merging. Most of the git operations relay on merging, and that wont work on binary data. The idea of compression factor 0 is interesting, but most of the time the merging will leave the merge marks in the file and give you a conflict, which no one can handle on our data...
Cloning on git means to copy the whole repo, which are tons of unneeded data in this case...
Also sync operations retrive all changes from other branches, needed or not.
But the single most biggest problem is the complexity of git operations! Even we as software developers still struggling to cope with this complexity. Imagine this complexity thrown on a mechanical engineer! That will never ever work!

SVN in contrast has some advantages:
If you checkout a sandbox you copy/transfer only the files of the head revision.
SVN stores diff sets for the revision, which lower (diff works in some bounds on binary data) the data footprint on the server, but makes checkouts slow.
The revision keeping is much easier to get. Are just numbers which get increased. No fancy hashes...
SVN can be browsed in a browser without further work and can be mounted as a drive (WebDAV).
Last, but not least, you can do locking on the server. I don't think we can miss this feature on big CAD projects, since merging will not work for a long time.

So...
IMO SVN is the better solution for CAD repo.

What we would need anyway for the future is a diff/merge driver. Any of the revision control systems allow to plugin a custom merge/diff program.
In our case this would be a python script which gets two *.FCStd files and try to diff/merge it.
One could make this very smart, up to scanning for features and show the user differences in the properties, so he/she it choose which version to use.
As far as I know this is never be done for CAD data - merging parametric CAD files by analyzing the features and merge them on that bases...
Stop whining - start coding!
User avatar
yorik
Site Admin
Posts: 11163
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Starting parts

Postby yorik » Tue Jul 02, 2013 4:59 pm

Wow, that would indeed be something never done before...

Actually of course git is far from the best solution, but at least it allows to store Parts somewhere, and begin a library. It is a temporary solution.
I think when we have a good collection of parts, it will be much more interesting to find a better system (read: more motivation for someone to build such system :)
User avatar
rockn
Posts: 1516
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

Re: Starting parts

Postby rockn » Tue Jul 02, 2013 6:53 pm

yorikvanhavre wrote:Yes you can try with ssh (on the github page you can get ssh url instead of the https one. I'm not totally sure what's the difference... In any case, I used the ssh version here and all works ok.
But wood-galaxy is your github username? I only authorized user "rockn", that might be the cause...
Another thing, once you did "git clone", git already knows what is the URL to push. So you can just do "git push" after that...

BTW, I just added a first part, with a fcstd file, a step file, and an stl version, and miracle! github has an stl viewer, have a look! (You must have a webgl-enabled browser)
Yes wood-galaxy is my github username. Please authorized me ;)

It's pretty cool to see 3d object in github ! Nice !
Formations et tutoriels FreeCAD en Français, soutenez moi : https://www.tipeee.com/formations-freecad
User avatar
shoogen
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Starting parts

Postby shoogen » Tue Jul 02, 2013 6:58 pm

thanks Jürgen for bringing up the locking and mountig. I havent thought of those. Most of the other drawbacks of git are just features that we need not to use. I think that the ordinary user should not use bare (command line) git or svn commands.
As I said above the Difftool for FCStd will unlike produce 'patches' and the merge tool is going to be full FreeCAD (with GUI) that highlights changes and conflicts. I think producing human readable diffs (not just diffing the xml and brep files)

Code: Select all

part a was moved
part b was replaced by part c
the numerical value of constraint d in sketch e was changed from f to g 
is something that's easy and can be started tomorrow. Whereas doing (automatic) merging is something one could write a thesis about ;)

Going back to the Repository:
I think we should go on with the https://sourceforge.net/apps/mediawiki/ ... rk_project define what information should be stored as metadata in the library and which could be available as well.
And then we can implement backends for the ressource framework.
And one of these backends would be a git repo, the next would use svn, another one would be the thingiverse api, and could be an interface to OpenPLM. And if those still don't fit our needs wee can still implement our version control system.
User avatar
yorik
Site Admin
Posts: 11163
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Starting parts

Postby yorik » Tue Jul 02, 2013 8:25 pm

rockn wrote:Yes wood-galaxy is my github username. Please authorized me ;)
Okay, that's done. I removed user Rockn... The guy must have wondered what I wanted :)
shoogen wrote:is something that's easy and can be started tomorrow.
Indeed that would be only dezipping and parsing the xml data... It can even be done outside freecad. Although it might be a nice feature to have in FreeCAD, something to run in command line. Comparing 2 parametric features would actually be quite easy, one would only need to step through all the properties and check if their values are the same. Comparing 2 documents could be just the same, and compare objects that have the same name.