Macro for unrolling ruled surfaces

Need help, or want to share a macro? Post here!
donovae
Posts: 8
Joined: Thu Sep 12, 2013 5:25 pm

Macro for unrolling ruled surfaces

Postby donovae » Thu Sep 12, 2013 5:36 pm

Hello,
I have made a macro in python to unroll ruled surfaces.
If possible I would like to post it for example in the macro recipes contribution.
What is the procedure ?
User avatar
shoogen
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Macro for unrolling ruled surfaces

Postby shoogen » Thu Sep 12, 2013 5:58 pm

If you just want it to be included you can publish it here and someone will edit the wiki, in order to include it.
If you intend to contribute more than once, you can request wiki edit rights, to modify the wiki by yourself. viewtopic.php?f=21&t=2268
donovae
Posts: 8
Joined: Thu Sep 12, 2013 5:25 pm

Re: Macro for unrolling ruled surfaces

Postby donovae » Fri Sep 13, 2013 7:50 am

Ok,
You will find enclosed the macro. I add some information. If not that clear, I may help editing the wiki.
-----------------------------------
* Installation:
- Extract .tar.gz in $home/.Freecad/Mod
* Options:
- Number of generatrix
- Scale manual or automatic
- Page format: a3/a4, cartridge (cf FreeCAD templates)
- Group drawings in the same page as possible.
* Instruction for use:
- Select a ruled surface
- Explode it (cf Draft menu)
- Select the surfaces
- execute the macro
-----------------------------------
That's all...
Attachments
unrollRuledSurface.tar.gz
UnrollRuledSurface macro - 13/09/13
(51.37 KiB) Downloaded 407 times
User avatar
yorik
Site Admin
Posts: 12058
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels, Belgium
Contact:

Re: Macro for unrolling ruled surfaces

Postby yorik » Fri Sep 13, 2013 1:45 pm

If you feel like adding your macro to the wiki ( http://www.freecadweb.org/wiki/index.ph ... os_recipes ) yourself, that would be cool! I can give you edit rights right now, but first, you need to go to your sourceforge account, and set "Mail alias behavior" to "accept all mail", because the wiki will sent you credentials via your sourceforge email.
donovae
Posts: 8
Joined: Thu Sep 12, 2013 5:25 pm

Re: Macro for unrolling ruled surfaces

Postby donovae » Fri Sep 13, 2013 2:41 pm

Ok, the change of mail parameter in my SourceForge account is made.
User avatar
yorik
Site Admin
Posts: 12058
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels, Belgium
Contact:

Re: Macro for unrolling ruled surfaces

Postby yorik » Fri Sep 13, 2013 3:45 pm

Ok, you should receive a confirmation mail from the wiki. Any problem, just tell me!
mario52
Posts: 3217
Joined: Wed May 16, 2012 2:13 pm

Re: Macro for unrolling ruled surfaces

Postby mario52 » Sat Sep 14, 2013 10:31 am

hi donovae
I am allowed to edit your page Macro_unrollRuledSurface
If you do not like my edits, you can restore your original page by " display history then click on defeat "
otherwise, make your corrections and throw an eye on the page "en"

Bonjour
je me suis permis de modifier votre page Macro_unrollRuledSurface
Si mes modifications ne vous plaisent pas, vous pouvez rétablir votre page originale en faisant "Afficher historique puis cliquez sur défaire"
sinon, vous pouvez apportez vos corrections et jeter un œil sur la page "fr"
mario
Last edited by mario52 on Sun Sep 15, 2013 7:47 pm, edited 1 time in total.
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting, Dialog creation. My macros on Gist.github.
donovae
Posts: 8
Joined: Thu Sep 12, 2013 5:25 pm

Re: Macro for unrolling ruled surfaces

Postby donovae » Sat Sep 14, 2013 10:48 am

All's rigth. Thanks mario.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Macro for unrolling ruled surfaces

Postby NormandC » Sun Dec 22, 2013 5:30 am

Did anyone try that macro? I followed the wiki instructions on how to use it, but all I get is this error:

Code: Select all

Traceback (most recent call last):
  File "/home/normand/Dessins/Macros_FreeCAD/unrollRuledSurface.py", line 90, in proceed
    unroll_l.append( unrollRS.unroll(faces[id]) )
  File "/home/normand/Dessins/Macros_FreeCAD/unrollRuledSurface.py", line 203, in unroll
    devlxy_l=self.devlxyz( sd1 , sd2 )
  File "/home/normand/Dessins/Macros_FreeCAD/unrollRuledSurface.py", line 297, in devlxyz
    a1b1n.normalize()
Exception: Cannot normalize null vector
Update: actually it works with a cone primitive, but not with a cone produced by revolving a sketch... Odd!

OS: Ubuntu 12.04.3 LTS
Platform: 64-bit
Version: 0.14.2888 (Git)
Branch: master
Hash: 5224e9a2ba961ba071b4ecbcefad228ef4c9e6fc
Python version: 2.7.3
Qt version: 4.8.1
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.0
donovae
Posts: 8
Joined: Thu Sep 12, 2013 5:25 pm

Re: Macro for unrolling ruled surfaces

Postby donovae » Sun Dec 22, 2013 6:25 pm

hull.fcstd
Test file - hull
(120.41 KiB) Downloaded 266 times
Hello,
The macro is to be used with ruled surfaces made with the Loft module.
One issue is to choose the edges between which the generatrices will be drawn.
I have just updated the macro and add an option for this point.
You will find enclosed another example.