YORIK’S COFFEE CORNER

This is the 2012 archive of my guestblog.


permalink:  193   posted on 19.12.2012 7:07
From satish goda
Commenting post 96: Nicely written

- Satish
learningblender3dsoftware.blogspot.com

permalink:  192   posted on 17.12.2012 20:52
From Wolfgang Vogelbein
Commenting post 180: I am looking for an e-mail address so that I may comment about the Material_Data_Model. I may be reached on xxxx@xx.xx

permalink:  191   posted on 14.12.2012 16:04
From jolmil
Commenting post 28: kakoje krasiwaje zdanije.

in categories  works  3d  blender  permalink:  190   posted on 11.12.2012 16:04
From Yorik

Shopping mall images



A couple of images (blender internal renderer) of a shoppjng mall. Project by Renato Bianconi.








in categories  linux  opensource  permalink:  189   posted on 09.12.2012 19:24
From Yorik
One-liner script to fetch current temperature (BRXX0232 is the yahoo weather code for São Paulo):

curl --silent "http://xml.weather.yahoo.com/forecastrss?p=BRXX0232&u=c" | 
grep -E 'temp=' | cut -d "=" -f3 | head -c 3 | tail -c 2

permalink:  185   posted on 08.12.2012 1:43
From www.frensis.com
Commenting post 180: thank you for the nice and easy tut. very clean and interesting

permalink:  188   posted on 07.12.2012 1:53
From Rafael
I love the last garden...

permalink:  187   posted on 06.12.2012 15:51
From stan
Commenting post 180: pretty amazing Yorik!

in categories  blender  sketches  works  3d  permalink:  186   posted on 05.12.2012 16:29
From Yorik

cycles + hand renders



More of those images made in gimp on top of a cycles render... Project by Adriana Furst. The last one is a garden design made 100% in gimp. Why use autocad anymore?






permalink:  184   posted on 04.12.2012 22:24
From David Rylander
Commenting post 183: Thank you very much!
I'm working on a bash script to do the same thing but haven't got it to work reliably, which is a bummer when I'm about to render a 50.000 frames sequence...
Your script saves me a lot of work and will be a huge help

in categories  linux  blender  opensource  permalink:  183   posted on 04.12.2012 13:46
From Yorik

Checkframes utility


A little python utility to check that frames series you download from a render farm are okay (no frame missing, no frame with 0 byte size). Made on Linux, but should work on any platform. On Linux, place this script in your /home/$USER/bin folder (or any other that is in your $PATH), make it executable, then just run this script from a folder containing frames, or a folder containing subfolders. Enjoy!

#!/usr/bin/python

#***************************************************************************
#*                                                                         *
#*   Copyright (c) 2012                                                    *  
#*   Yorik van Havre                                  *  
#*                                                                         *
#*   This program is free software; you can redistribute it and/or modify  *
#*   it under the terms of the GNU Lesser General Public License (LGPL)    *
#*   as published by the Free Software Foundation; either version 2 of     *
#*   the License, or (at your option) any later version.                   *
#*   for detail see the LICENCE text file.                                 *
#*                                                                         *
#*   This program is distributed in the hope that it will be useful,       *
#*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
#*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
#*   GNU Library General Public License for more details.                  *
#*                                                                         *
#*   You should have received a copy of the GNU Library General Public     *
#*   License along with this program; if not, write to the Free Software   *
#*   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
#*   USA                                                                   *
#*                                                                         *
#***************************************************************************

"""This utility checks the current folder and any of its subfolders for jpg, png
or exr image sequences, numbered 0001.jpg, 0002.jpg, etc... and checks that no
frame number is missing, and that no image is corrupted (sero-size)."""

import os,sys
from PIL import Image

# keeping count of errors
errors = 0

# getting working paths
homepath = os.path.abspath('.')
subpaths = []
for p in os.listdir(homepath):
    ap = homepath + os.sep + p
    if os.path.isdir(ap):
        subpaths.append(ap)

subpaths.sort()

# add current path too
subpaths.insert(0,homepath)

# checking frames
for p in subpaths:
    print(" ")
    print("checking folder "+p)
    frames = []
    for i in os.listdir(p):
        if i[-4:].upper() in ['.JPG','.PNG','.EXR']:
            frames.append(i)

    if not frames:
        print("    This folder doesn't contain frames")

    else:
        # counting frames and checking numbers
        frames.sort()
        try:
            last = int(frames[-1].split('.')[0])
        except:
            print("    Error: couldn't parse frame numbers in this folder")
            continue
            
        if len(frames) != last:
            print("    Error: frame numbers differ from frames count in this folder: 
	last frame is "+str(last)+" but contains "+str(len(frames)))
            ext = frames[-1].split('.')[1]
            for i in range(1,last+1):
                fn = str(i).zfill(4)+'.'+ext
                if not fn in frames:
                    errors +=1
                    print("    Missing frame: "+fn)
    
        # displaying info of first image
        try:
            imf = Image.open(p+os.sep+frames[0])
        except:
            print("    Error: cannot open image "+p+os.sep+frames[0])
            continue
        else:
            print("    "+str(last)+" frames - format: "+imf.format+" - "+str(imf.size[0])+"x"+str(imf.size[1]))
    
        # checking size
        for f in frames:
            fp = p+os.sep+f
            s = os.path.getsize(fp)
            if s < 1024:
                print("    Error: zero-sized file: "+fp)
                continue
                
        # subdir succeeded
        print "    Everything ok"

# all tests are done
print(" ")
if errors:
    print(str(errors)+" errors found")
else:
    print("Success: All frames are ok")
    
sys.exit()

permalink:  181   posted on 27.11.2012 2:17
From Rafael
Commenting post 180: Man, this is amazing!! Blender + FreeCAD and parametric!! Wow! O_o I don't know what to say. Even you can print a drawing or export CAD sections!!! MASTER!!!

in categories  freecad  opensource  blender  permalink:  180   posted on 26.11.2012 20:37
From Yorik

FreeCAD Arch module how-to


In this article I'll try to describe you the new Arch module, that will be available in the soon-to-be-released version 0.13 of FreeCAD. I built a small model with it, in order to walk through the different components and tools currently available.

This project is based on a Blender model that I made during the first phase of the project. FreeCAD is a very precise tool, where things such as modifying objects takes much time. For that reason, when what you want is speed, you are definitely better with a faster, free-form modeler such as blender or sketchup. Nowadays, once you built a very imprecise model, it is fairly easy to make things straight and with the right dimensions in Blender, thanks to the very good snapping tools. You just need to build a couple of reference edges, that set things like external dimensions, roof height, and you can snap all your building to them.



Importing a blender model into FreeCAD is extremely reliable. You have several "transport" formats available (OBJ, STL, DAE), but i always prefer the OBJ format, because it is human-readable, it is well implemented in both Blender and FreeCAD, and it allows fairly complex concepts such as NGons (DAE relies on external components in both applications, and STL reduces everything to the most basic entities). All you need to do is select your objects to be exported in Blender, export to an OBJ file (a corresponding materials file will be created, but that one is not used by FreeCAD), and open it in FreeCAD. Due to the Z/Y orientation of OBJ files (the Z is not pointing "up" but "towards you"), you may need to give all imported objects a 90° rotation on X axis, with their placement property.

Once this is done, you can use that mesh as a base to build your model. You could transform your blender objects directly into Arch objects (Creating a wall or structure with a mesh selected automatically turns it into a wall or structure, provided it is solid an dnon-manifold), but in this case I wasn't too sure about the thickness of my blender walls, and I prefered to start from scratch. I started by drawign some guidelines, mostly to have something to snap to later on.



After that I used the wall tool on my line segments, mostly to check if all worked ok, and to see which wall I would align externally, and which one centrally.



I added two axes systems, and a column. By adding axes systems to a structural element, you turn it into an array. If you add one axes system, the structural element gets copied once on each line. If you add two systems, it gets copied on each itersection of the two systems. That is what I used here to place the columns at the appropriate locations.



Finally, I joined all my base lines with the upgrade tool into two objects, one for exterior walls and one for interior walls (they would have different thicknesses and alignment), and converted them into sketches. Then, I adjusted all the internal lines of the sketches, and rebuilt two new walls on top of them. By adding one wall to the other, you make them union (but they are kept as separated objects in the objects hierarchy). This is the big advantage of parametric modeling, all is undoable, modificable.





I then began to work on the bae slab, which in this case is pretty complex, features many different levels, stairs, etc. I basically worked by laying draft wires, then extruding them and turning them into structural elements. I also placed a couple of helper dimensions, to help me figure out how I would do the stairs.



The stairs are pretty simple, once I calculated the size of one element, I just duplicated it a couple of times.







I then added the windows and doors. Both windows and doors are made with the same window tool (after all, a door is only a special case of a window). If you have a face selected when you press the window tool, it enters in sketch mode, allowing you to draw the window directly on the wall. You can use all the sketcher tools such as importing external edges from the wall to place your window accurately. By default, if you draw your window with two closed wires, one inside the other, when you close the sketch, a defualt window will be created by extruding both wires and subtracting the inner one. But you can make about any combination you want, and the different components (the extrusion depth, which wire must be subtracted, etc) is all configurable in the window's edit mode. Just remember to always draw closed, non-overlapping wires.

Doors are made exactly the same way, only the base of the interior rectangle is aligned with the base of the exterior rectangle (the vertical distance between the two edges is 0).

Here I also added the brise-soleils by making a rectangle, another one smaller by offsetting the first one, then subtracting it from the first one, then extruding, the using the Draft array tool to make the serie of 8 brises.



I also made two beams, with a structural element to which I added one of the axes systems, and then added a roof slab, by extruding a rectangle, then adding a small wall on its border. The wall is then added to the slab.

I then added all the objects of the model to a floor object, which will be easier to make sections, since you can assign one floor object to a section, and it will automatically cut through everything that is inside the floor.



Time for a fist test of a plan view, by adding a horizontal section plane object:



I finally added the big window on the front, by building a rectangular block first, which would give me a face to support the window. I then built a sketch on it, with one exterior rectangle and several inner rectangles. As soon as you exit the sketch, the window is created.



The house is now complete, we can add a couple of other section planes, to make sections and elevations.





And here is the final result on the Drawing sheet, I used the wireframe rendering for plans and sections, and the solid rendering for elevations. You will of course see imperfectiosn here and there, but remember that the development of the Arch module is a work in progress, and it will still take a lot of time before things are perfect. Anyway, I think this already begins to give us a good base.



From our section planes, we can also extract flat shapes directly in the document, by making Shape2Dview objects with them selected. I made two for each section, one showing everything, and one (with thicker line) showing only the cut lines.



These flat objects export very wall to DXF, with absolute precision. You can then use them to build more complex 2D drawings.



That's about it, in the Arch module you will also find a couple of other helper tools, mainly made to help you to convert meshes to arch objects (split meshes, detect non-manifold ones, etc), and a roof tool, which is still pretty experimental, but already works fine for simple roofs. Remember that all this is still being developed, so don't expect to find the same workflow as in commercial applications. You will likely need to go back, try other methods, etc... several times during your work. But I hope I could demonstrate that the foundations are there, and that FreeCAD can begin to have its place in a productive workflow.

The final FreeCAD file can be downloaded here, but remember that until version 0.13 is released, you will need a development version to be able to open the file.

And don't forget, FreeCAD has a lot of documentation and a very cool community that can help you to get on tracks with it...

permalink:  179   posted on 23.11.2012 21:04
From Yorik
Commenting post 178: Salut christophe,
Oui bien sur, mon email: yorik (at) uncreated (dot) net

permalink:  178   posted on 23.11.2012 19:20
From Delrée Christophe
Bonjour,

Parles-tu Français? Je t'écris de Belgique. Un ami à toi , Janis Hesse, m'a renseigné ton site.
Tes images sont magnifique !!!
Puis-je te poser quelques question?

permalink:  177   posted on 17.11.2012 2:07
From Yorik
Commenting post 176: Hi,
No, unfortunately the site I was hosting the files at that time went down, and I lost a couple of assets. Have a look at the textures I have now, probably you can use similar ones and change a bit their colors... Sorry about that!
http://yorik.uncreated.net/archive/ngplants/

permalink:  176   posted on 17.11.2012 1:36
From Lawrence D’Oliveiro
Hi. Recently (re)discovered your “Blender Greenhouse” files. They seem to open just fine in Blender 2.64, except that the Jacaranda one seems to be missing the leaf and flower textures. You don’t happen to have them anywhere, do you?

in categories  linux  opensource  permalink:  175   posted on 16.11.2012 23:46
From Yorik

Note to self: How to set a file manager as default in X

Sometimes, when you arenot using gnome or kde, you press the dropbox icon, and firefox opens to display the contents of your Dropbox directory, instead of your default file manager. This is easily fixed by adding or changing the following lines in $HOME/.local/share/applications/mimeapps.list (in this case, I'm using pcmanfm)

[Added Associations]
x-scheme-handler/trash=pcmanfm.desktop;
inode/directory=pcmanfm.desktop;

[Default Applications]
application/x-directory=pcmanfm.desktop
x-scheme-handler/trash=pcmanfm.desktop
inode/directory=pcmanfm.desktop

permalink:  174   posted on 13.11.2012 15:12
From Yorik
Commenting post 173: Hi David,
Probably some library missing... Try launching blender from a terminal: Open a terminal, and type "blender" (without the quotes) and press "enter". See if some error message appears... Then if you search on the ubuntu forums, maybe you'll find other users with the same problem, and probably a solution too.

permalink:  173   posted on 13.11.2012 15:07
From David R. Hellström
Hej!

Thank you! Did work but now when i update to 12.10 blender dosn't start.... and i don't have idea why, iclick the icon blender but nothing happenig....

permalink:  172   posted on 24.10.2012 4:40
From Randy Bell
Commenting post 28: The overall space is very simple in design, but the drawings and renders are a joy to look at. I've been a fan of your work for some time now. Excellent work.

permalink:  171   posted on 15.10.2012 18:51
From Yorik
@Raimon: Right now, because of a bug between the latest debian nvida package and draftsight, I installed the driver manually from the nvidia website. So at the moment I have none of the opencl packages installed... But maybe it's simply a config question (they changed several times recently)... In my case, I need to set the features set to "experimental" in the render panel, then go to the user prefs and check "opencl", then I have the gpu options appearing on the render panel...

@David: I see the pavillion t780 has a Radeon display chip, right? Probably you need to install the proprietary (non-free) ATI driver, which allows for proper 3D performance under Linux. Look for "fglrx" in the software center. Usually Ubuntu installs the free driver by default, which is still in very bad shape for 3D...

permalink:  170   posted on 14.10.2012 21:45
From David R. Hellström
HI Yorik!

I use Blender and Linux (ubuntu 12.04) and i love architecture.... But every time i'm using blender or another 3d program as Skechtup my computer freeze and i have to hardstart it again... I lover Linux and i don't wanna go back to windows but as i said before i kan never finish a project... i'm not an expert on Linux but i have a HP pavilion t780.se..... Excuse my English

permalink:  169   posted on 05.10.2012 16:21
From Raimon
Hi Yorik,

I'm a blender fellow working in archiviz too .
I ran into problems with my graphics drivers, in Debian Wheezy like you: I've almost resolved this, but OpenCL option disappeared from my Blender Preferences so I guess OpenCL isn't working on my system. I would like to know what opencl related packages have you on your system, if possible. Thanks in advance!
Raimon

permalink:  168   posted on 28.09.2012 1:21
From Convite para palestra
Olá,

Gostaria de convidá-lo para proferir uma palestra no VI Simpósio de Informática do IFNMG Campus Januária. O IFNMG é uma instituição acadêmica que ministra cursos superiore e técnicos na área de TI e acredito que uma palestra sua sobre software livre irá despertar nestes jovens várias ideias sobre o pensamento livre.

O Simpósio de Informática é um evento em que buscamos proporcionar aos nossos alunos uma mudança da rotina da sala de aula e apresentar-lhes novas tecnologias e conhecimentos. O planejamento do evento é o seguinte:

-Nome: VI Simpósio de Informática do IFNMG
-Data: 21 - 23 novembro 2012
-Público alvo: alunos, professores e técnicos administrativos da área de informática do IFNMG (pretendemos convidar interessados de outros campi)
-Número esperado de participantes: 400
-Local: IFNMG Campus Januária/MG

permalink:  167   posted on 24.09.2012 15:13
From C.Miguel
I write these lines only by gratitude. Not long ago told me that FreeCAD was not for production, but it is very exciting for me to version 0.13. Again Gracias

in categories  blender  permalink:  166   posted on 23.09.2012 18:19
From Yorik
Trying to make a decent sky gradient (it's harder than you would think...)



Blender file here: http://yorik.uncreated.net/scripts/horizonte.blend

permalink:  165   posted on 15.09.2012 19:51
From reint
Hi, just followed the architecture creation tutorial. Two things I found out for the blender 2.63 that were mentioned in this tutorial.
First: GLSL shading, view textures while modelling. N_key-display-shading-glsl-view textures in 3d mode! Very nice feature I was looking for for a few weeks and finally found.
Second: Planes from Images (is now an addon/script) Imports images and creates planes with the appropiate aspect ratio.
Thanks.

permalink:  164   posted on 14.09.2012 14:04
From Rafael
great work. keep on.

permalink:  163   posted on 12.09.2012 18:44
From Yorik
Commenting post 162: Hi,
As far as I know nobody has yet tried to port this script to 2.6x... It's on my todo list, but I canoot tell you when I'll find the time to do it. In the meantime, though, there are several viable solutions, such as passing through FreeCAD (you need a development version) or SketchUp... Both are able to output decent sections of a blender model.

permalink:  162   posted on 12.09.2012 16:58
From Charles Berkley
Hi, not sure if this is the right place for this but, I'v bee looking around the net for a functioning cross section script for blender 2.63 and up, I really need something that does exactly what that script does in blender right now , any chance I can be linked to a resource for a functioning blender 2.63 and up script of this kind, even if its a beta as long as it can be used, or maybe the old one can be up dated, I really need it and I have no idea how to write a script myself any help will be appreciated, thanks.

permalink:  161   posted on 07.09.2012 17:46
From reidh
Commenting post 73: very, very good, new, helpful, cool, not found in many commercial pkgs. Thank You

permalink:  160   posted on 05.09.2012 13:32
From pyrit
wohaaa !
looks very nice.
! thanks to the developers !

permalink:  159   posted on 04.09.2012 10:20
From silopolis
Commenting post 158: Great, great news !
Please keep on this excellent work.
Bests

in categories  freecad  opensource  permalink:  158   posted on 03.09.2012 23:17
From Yorik

Latest developments of the FreeCAD Arch module



This is a small sneak preview of what is possible with the 0.13 version, to be released very soon (you can already test by installing a development version). This is nothing comparable to commercial solutions yet, but it already allows to do some useful work:



It is now quite easy to import mesh objects from Blender or other mesh-based application. If they are closed, solid, non-manifold and have their normals correctly pointing outwards, they convert to Arch objects without problems. The procedure is simple: Select an object in Blender, export it to .obj, import it in FreeCAD, give its placement a rotation of 90° on the X axis (because obj format inverts Y and Z axes). Select it in FreeCAD, separate it if needed (Arch -> Split Mesh) then press the "Wall" button and that's it, it is now a wall, with all its properties.



There are now several graphical goodies to make your 3D workspace more interesting: axes systems, different linewidths, different linestyles, smart grouping, etc. FreeCAD is now becoming more stable everyday, and you can begin to work comfortably with a reasonable number of objects, and keep things fast.



The Arch section plane object now has more powers, it can not only put 2D views on a drawing sheet, like before, but you can also create a real-scale 2D view of its objects right in the 3D document, with the Draft 2DView tool. The advantage is that you can then export the 2D view to DXF with absolute precision. The Draft 2DView tool also allows to show only cut lines, so you can build nice sections, easy to export to your favorite 2D CAD application.



That's it for now (I have a longer article in preparation), probably there won't be any significant changes until the 0.13 release, but there are many ideas ready to be added just after.

in categories  freecad  opensource  linux  permalink:  157   posted on 02.09.2012 21:06
From Yorik

Handling IFC files on Linux

Working with IFC files on a linux system is still not something easy, but there are already a couple of things you can do:

1. Add a MIME type

To have .ifc files recognized, add a file named "application-x-extension-ifc.xml" to ~/.local/share/mime/packages (or /usr/share/mime/packages for system-wide) with this content:

<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
	<mime-type type="application/x-extension-ifc">
		<sub-class-of type="text/plain"/>
		<comment>Industry Foundation Classes</comment>
		<glob pattern="*.ifc"/>
	</mime-type>
</mime-info>

Then run "update-mime-database ~/.local/share/mime" to update your mimetypes database.

2. Add an icon

Grab an icon from here, and save it as ~/.icons/x-extension-ifc.png (or /usr/share/icons/x-extension-ifc.png for system-wide). Now your file manager should display IFC files a bit more nicely:

3. Open IFC files

There are currently no applications that can save ifc files (might change sooner than you think, however), but there are already a couple of solutions to open them. The following example is taken from the buildingSmart examples page ((Duplex model):

FreeCAD: Can open IFC file with its internal parser (not all entiites are supported and, starting from version 0.13 (to be released soon), is able to use IfcOpenShell if it is installed on your system, and with it, can import the whole contents of an IFC file:



OpenIfcTools: Has a javawebstart viewer, simple but very good for quickly inspecting IFC files:



Blender: Can also open ifc files when IfcOpenShell and its blender importer addon are installed. Although it uses the same IFC import engine, the file import operation is much faster than FreeCAD, because the mesh data that blender uses is much quicker to construct than FreeCAD's more complex parametric objects:



BimServer: The BimServer is a multiplatform server application, made to share, review and maintain IFC-based projects. It has several interesting functionalities such as conversion to/from several other formats, cobie support, revision control, etc... It has also a WebGL viewer program for it (called BimSurfer), which can render a the project in WebGL (3D inside your web browser):

5. Save IFC files

This is not yet possible, but Thomas Krijnen, the guy behind IfcOpenShell is working on it, so very likely Blender and FreeCAD will be able to output IFC files in some near future.

in categories  freecad  opensource  permalink:  156   posted on 31.08.2012 23:42
From Yorik

Minha Palestra do FreeCAD no youtube



O pessoal do FISL gravou a palestra sobre FreeCAD que fiz no FISL13. Aqui está integralmente, for your viewing pleasure:


permalink:  155   posted on 23.08.2012 18:21
From Jarope
Commenting post 28: Hi Yorik,
Great inspiration for Open Source! I am not an architect but still find your blog a great read!

Many thanks and please more on how you work between Blender and FreeCAD!

jarope

permalink:  154   posted on 23.08.2012 10:47
From samit
Thanks Yorik, your links were certainly helpfull.

permalink:  153   posted on 20.08.2012 3:25
From stan
Commenting post 96: thanks Yorik, i've tried learning python by myself before but failed, your post made me want to try it again!

permalink:  152   posted on 18.08.2012 22:52
From Yorik
Commenting post 151: Hi Samit,

Really it is not the aim of the Draft module to be standalone... It exists only to be a "helper" module in FreeCAD, and there are no plans to do it otherwise, which would be such a huge task that it would be easier to start it all again. All of the interesting functionality in FreeCAD comes from the OpenCasCade library, which is a huge 3D modeling kernel, probably way too big to work on the Raspberry Pi.

I think you should be able to find much simpler programs by looking a bit on the web... I remember something called avoCADo ( http://avocado-cad.sourceforge.net/ ), and there are web-based solutions too ( http://shapesmith.net/ ). Hope it helps!

permalink:  151   posted on 18.08.2012 18:36
From Samit Ray
hi Yorik,
I am from India, I was looking around for a light and simple "CAD" like program for educational program for kids
the aim is to introduce geometric shapes to children on the "Raspberry Pi" (worlds smallest computer)
I am thinking on the lines, if the ONLY Draft work bench can be used standalone as the Rasberry Pi has limited resources, is this even possible with FreeCAD, can we make modules operate standalone, I am a programmer
by profession and have the motivation to get my hands dirty if required.

Samit

permalink:  149   posted on 11.08.2012 22:27
From pyrit
I know this is not a vector rendering :-)
but im interested in combining the normal rendering eg cycles with technical illustraions.
for example if you have an ortho view and want to give it some depth by incorporating a render ...
thx !

permalink:  146   posted on 11.08.2012 21:10
From Yorik
Commenting post 144: Hi,
Actually that image is not a vector rendering, it is a normal rendering like you can do in blender. All you need to do is cut through your model, for example by making a big cube and subtracting it... But yes, one of the aims of the vector renderer is to be able to do sections like that. I didn't look at perpective projection yet, though.

permalink:  144   posted on 11.08.2012 20:28
From pyrit
Commenting post 54: wow !
is this possible to combine with blender to get results like this ?
hogartharchitects.co.uk/gallery/Section%20Render%20H.jpg
ty!

permalink:  143   posted on 10.08.2012 1:31
From Rafael
Commenting post 142: o_O Incredible. Congrats!

in categories  freecad  permalink:  142   posted on 10.08.2012 1:03
From Yorik

More work on FreeCAD


These days I had less time to work on FreeCAD, but I've been working a bit to solidify the Arch module, and refined a bit the 2D export. There are now 2 modes, solid, which uses the Arch vector renderer, and wireframe, which uses the standard Drawing module algorithms. That last mode now also draws sections with thicker lines (settable in the Arch preferences), and can also show the hidden part, behind the cutting plane.






in categories  blender  opensource  permalink:  141   posted on 02.08.2012 23:20
From Yorik

Building luxrender on linux



I wrote this little article mostly because I had to reinstall Luxrender (mostly to try Luke's work), and this will serve me as a memo for another time. The info below comes mostly from the official instructions.

First, you must install the dependencies listed on the official page above. Here luckily I already had all of them. Then, the luxrender system comes in 2 parts, luxrender and luxrays. So it's best to create first a containing folder, then clone the 2 repositories:

mkdir Luxrender-source
cd Luxrender-source
hg clone http://bitbucket.org/luxrender/lux
hg clone http://bitbucket.org/luxrender/luxrays
hg clone http://src.luxrender.net/luxblend25

Then, prepare for out-of-source build for luxrays:

cd ..
mkdir Luxrender
cd Luxrender
mkdir luxrays
cd luxrays
cmake ../../Luxrender-source/luxrays

Then, because of some bug between openCL 1.2 (which is the version I have here on debian wheezy) and 1.1 (which is used by lux), you must use the -DCL_USE_DEPRECATED_OPENCL_1_1_APIS option when compiling. The easiest way is to use cmake-gui:

cmake-gui .

Then add "-DCL_USE_DEPRECATED_OPENCL_1_1_APIS" to CXX_FLAGS and C_FLAGS. Press "Configure" then "Generate".

For me the luxrays library then compiles fine, but the benchmarks failed. But there is an option to compile the luxrays lib only:

make luxrays

If all went okay, let's do lux:

cd ..
mkdir lux
cd lux
cmake ../../Luxrender-source/lux

It will complain that luxrays was not found. Then, start cmake-gui:

cmake-gui .

And change the value of LUXRAYS_LIBRARY to the path of your luxrays/lib/libluxrays.a file. Also add the same compiler option as in luxrays above. Press "Configure" then "Generate". Then, build:

make luxconsole
make luxrender
make pylux

Now, go back to the luxblend folder and link pylux there:

cd ../../Luxrender-source/luxblend25
ln -s ../../Luxrender/lux/pylux.so

Then link the luxblend folder and the presets into your blender scripts folder:

cd ~/.blender/2.6X/scripts/addons
ln -s /path/to/Luxrender-source/luxblend25/src/luxrender
cd ../presets
ln -s /path/to/Luxrender-source/luxblend25/src/presets/luxrender

Then, all you need to do is open blender, activate the plugin, and set the path to /path/to/Luxrender/lux/ in the render options.

in categories  freecad  opensource  inthepress  permalink:  140   posted on 01.08.2012 18:33
From Yorik

FreeCAD and the FISL



Maíra and me are back from the FISL. I've been presenting FreeCAD there (pdf of my talk here - in portuguese), and we also gave a Blender workshop.

The FreeCAD talk has been good, about half the room was filled, which is much more than I expected, CAD being a subject that fundamentally doesn't interest many people (and the fact that I had been assigned to one of the big rooms ) and nobody left the room during the talk, which is a good sign too. I kept talking with several people after the talk, got a couple of interesting feedbacks about the talk, a news article, and generally speaking got quite happy of how things went. Almost nobody in the room had heard or used FreeCAD before.

Of course there is still not much to show, no way to make a big show that will make people move to FreeCAD immediately, but it's a start. In any case, it's cool to have FreeCAD represented and featured among well-known projects such as ubuntu and firefox. I had hoped to find people interested in participating to the project, though, but I suppose that is something that cannot be forced.

Here are a couple of pictures of the event:









And one of the talk posted by www.baguete.com.br:


in categories  works  blender  sketches  3d  permalink:  139   posted on 01.08.2012 15:59
From Yorik

cycles + hand drawings


Two new images made with cycles (+ hand finish in gimp) for a project by Adriana Furst...




permalink:  138   posted on 01.08.2012 14:24
From Yorik
Commenting post 136: Hi Manuel_FR,
You must be aware that the script only works with Blender before the 2.50 version. So the latest blender version that works is 2.49. Secondly, the minor python version number must be the same between blender and freecad. For example, both blender and freecad must be based on python 2.5x or both on 2.6x (check in the console window when opening both programs). After that, it's just a matter of putting the right path, and it should work.

About the obj format, yes, that's what I use too, now that the importer doesn't work anymore...

permalink:  137   posted on 01.08.2012 3:03
From stan
Commenting post 128: good luck yorik!

permalink:  136   posted on 31.07.2012 17:32
From Manuel_FR
I've tried with older freecad (0.7) and Blender (2.48) version and Python (2.52), but this didn't work either. It said it could'nt find the freeCAD module.
I don't know if this can help, but I could finally import from FreeCAD exporting the file to .obj, and importing it into Blender. I apologize if post this post is at the wrong place.

permalink:  135   posted on 27.07.2012 22:15
From Manuel_FR
Commenting post 105: Hello. First I'd like to thank you for your work. It is very motivating to see all what you can do with FreeCAD and Blender. I've tried to install your script import_freecad.py, but it doesn't seems to work. I've tried with the install Add-On procedure in Blender, and also manually by inserting the file in the blender script/addons folder. But nothing happens. I've recently downloaded the FreeCAD0.12 version, and I can't find the FreeCAD.la library inside the installed files. Anyway, I've tried with setting the FREECADPATH variable to FreeCAD0.12in adress. Do you know if this is the reason why it doesn't work, and if I still can find this FreeCAD.la library in this FreeCAD version? Thank you.

permalink:  134   posted on 27.07.2012 20:13
From Yorik
Commenting post 133: not sure, there is a long time that I didn't look into those communities. But I think it's an inherent property of open-source software, to make you want to tweak it. After a time using something like blender, you begin to want to test the bleeding edge tools they are developing right now, so you learn jow to compile it yourself, then you are unsatisfied with how a tool works but you think it would be so little work to adapt the existing tool, so you look at the code to see if maybe you can do it yourself, then the shit is done

permalink:  133   posted on 24.07.2012 18:43
From car313
Commenting post 96: how is it that the blender community guys all seem to be artist+programmers? is this also the case with maya, modo, 3ds, houdini etc., community guys?

permalink:  132   posted on 23.07.2012 24:19
From Leonardo S. R.
Commenting post 128: The talks stream link:
htttp://softwarelivre.org/fisl13/streaming

permalink:  131   posted on 23.07.2012 22:09
From pyrit
ok thanks for pointing that out. i personally prefer 2d drafting also with rhino3d over autocad, because it feels just so more easy to use . dimensioning and hatching / publishing are not good but in therms of copying strectching, altering polygons with controlpoints its way better i think. this is what i really do not like about commercial software(rhino is here a good exception as well): they do realeases everey year. just to pack in some useless sht that no one needs. but forget about usability and simplicity. archicad for example goes in the right direction(bim) i think, but still havent managed to do correct clippings in sections(between ceiling wall, at least in archicad 13). thats what i really admire with the open source software, no selling fakes :-)

thanks again

permalink:  130   posted on 23.07.2012 21:51
From Yorik
Commenting post 129: FreeCAD is still too new. And since it is not made primarily for 2D, you go much faster with a pure 2D application. This should change in the future, though. And also, on this project, I was working with other people (who use autocad, of course), and it is still too soon to "force" other people to adopt FreeCAD

permalink:  129   posted on 23.07.2012 21:23
From pyrit
hi again,

thank your for the pdf example !
what are the benefits of draftsight over freecad ( in terms of drafting arch plans) because freecad really looks like a very nice programm ?

thank u

in categories  freecad  blender  opensource  permalink:  128   posted on 23.07.2012 20:59
From Yorik

FISL talks



This week I'll be giving a freecad talk (wednesday, 16h) (pdf) and a blender workshop (friday, 17h) (pdf) at the FISL in Porto Alegre. I'll post my impressions after the show here, and try to grab the video if it's filmed. See you there!




permalink:  127   posted on 23.07.2012 20:49
From Yorik
Commenting post 126: Hi,
The 2D is made with Draftsight (Autocad clone), the 3D is made with blender... Basically on that image, it's all matter of using different solid hatches, and putting them front or back one to another. I have a pdf example of another project here, if you want to have a closer look: http://yorik.uncreated.net/archive/projects/marlene.pdf

permalink:  126   posted on 23.07.2012 20:00
From pyrit
hi !
i just found your blog, while looking for open source cad programms. im an architecture student and would like to ask you about hatching, annotations, and linetypes.
http://yorik.uncreated.net/images/2012/lanxess05.jpg
i really like the style of this plan - plz tell which programms where used .

thank you !

permalink:  125   posted on 19.07.2012 9:22
From Martijn
FreeCAD is nu al mijn favoriete programma voor mijn tekeningen!
Enige probleem dat ik nog heb is om de dimensies in de tekeningen aan te brengen, maar te denken dat we het over versie 0.13 hebben dan zal de 1.0 release alle concurentie achter zich laten.

Overigens, mooie FreeCAD tutorials hier op freecad-tutorial.blogspot.pt

in categories  freecad  permalink:  124   posted on 17.07.2012 18:36
From Yorik
Whole morning working in freecad without one single crash, we're already doing better than autocad, aren't we?



Edit: End of the day, still no crash!


permalink:  123   posted on 02.07.2012 10:52
From Yves
Impressionnant, puissant et captivant.
Un énorme merci pour votre site et pour les ressources présentées.
Votre dévoué

permalink:  122   posted on 28.06.2012 18:53
From Rafael
Commenting post 121: oh, esta bien. no es importante. pero seguire atento por ver el resto de tu guia.

permalink:  121   posted on 27.06.2012 23:06
From Yorik
Commenting post 120: Algo muy pequeño
Sobre tu problema de python, realmente no comprendo lo que se pasa... Voy hacer el procedimiento todo aquí nuevamente para ver...

permalink:  120   posted on 27.06.2012 8:49
From Rafael
Commenting post 119: jejeje. Nice. Tu hablas Ingles, frances y Portugues. Se te olvido mencionar que tambien algo de espanol. XD

in categories  inthepress  permalink:  119   posted on 27.06.2012 2:20
From Yorik

permalink:  118   posted on 22.06.2012 2:37
From Rafael
yes, I did properly. Even I copied your script and saved as test.py file into Python27 folder, but nothing happen when I import test (it does not show the text "test.py succesfully loaded").

permalink:  117   posted on 20.06.2012 21:33
From Yorik
Commenting post 116: Hm... what is the contents f your test.py file? It looks like the sum() function wasn't defined properly...

permalink:  116   posted on 19.06.2012 9:13
From Rafael
Sorry, but not yet.
>>> import test
>>> test.sum(14,45)

Traceback (most recent call last):
File "", line 1, in
test.sum(14,45)
AttributeError: 'module' object has no attribute 'sum'
>>>
>>> import test
>>> from test import *
>>> sum(12,54)

Traceback (most recent call last):
File "", line 1, in
sum(12,54)
TypeError: 'int' object is not iterable
>>>
I have save the file test.py into the Python27 folder, but nothing...

permalink:  115   posted on 18.06.2012 23:03
From Yorik
@Rafael, there was an error in my example, indeed... the function needed "return(a+b)" instead of "return a+b". I believe it should work now!
@Alexandre, no specific addon for that, I believe, but you should be able to get the work done efficiently with standard blender tools...

permalink:  114   posted on 17.06.2012 24:47
From alexandre guerra
thanks for the architecture tips for blender looking for some add ons to help me design/develop furniture with precision obrigado!

permalink:  113   posted on 17.06.2012 8:41
From Rafael
mmmmm the examples (test.sum(14,45)) about modules did not work with me, maybe is becouse I'm using Python 2.7?

permalink:  112   posted on 10.06.2012 8:14
From Gabriel
awesome content in here! i'm coming back to product design and trying to evaluate all the tools i can use in linux. this is being a great help to point to some directions.

permalink:  111   posted on 08.06.2012 23:25
From Yorik
Commenting post 103: Salut Patrick,
Ça avance, lentement, mais ça avance!

permalink:  110   posted on 08.06.2012 23:22
From Yorik
Commenting post 109: Hi Nicolas,
Sure! http://yorik.uncreated.net/guestblog.php?tag=freecad&complete=3
Also have a loot at the FreeCAD homepage: http://free-cad.sf.net

permalink:  109   posted on 08.06.2012 23:17
From Nicolas Lussier
Commenting post 40: First Thank for sharing this it's 3 year later now !
Is the freecad project is goring ??
Is it plan to make freecad something like catia, solidworks, solidedge ... ??

Regards

permalink:  108   posted on 07.06.2012 22:06
From arqxyz
Commenting post 40: You can also use DraftSight, knowing handle autocad, know how to handle DraftSight.

permalink:  106   posted on 07.06.2012 13:43
From Gudeta
do not explain the procedures on how to do it. Let me try it first.

permalink:  105   posted on 07.06.2012 10:41
From Gudeta
Hi Yorik
Very happy to see the Python for architects!
It really helps us, in getting freedom and confidence of making tools that we'd like to have.
I was trying to make a small program for architects that calculates setback required for new design according to municipality rules. It will take street width /front, side, rear/ proposed building height, distance of existing buildings and calculates the setback distances from boundary. add a nice GUI, package it into an exe or something portable. Finally make a version that works online - but don't know if this possible,

then viola!

Cant wait to see the coming series. Thanks a lot.

permalink:  104   posted on 06.06.2012 15:48
From Yorik
Commenting post 102: Hi Rafael,
Funny, on python3, help(print) works, but not on python2... I should indeed add a notice.

permalink:  103   posted on 06.06.2012 9:45
From Patrick Depoix @ Lille, France.
Commenting post 96: Salut Yorik,

Je n'avais pas vu cette page mais grâce à Alan Brito, que je remercie, je suis heureux de l'avoir lu! Une petite révision bienvenue à tous les archis qui utilisent Blender..... Comment vas-tu? Ton premier projet se passe bien, je te le souhaite sincèrement.
Toutes mes plus cordiales salutations.
Patrick

permalink:  102   posted on 06.06.2012 6:32
From Rafael
Commenting post 96: One correction: help(print) must be: help('print')

permalink:  101   posted on 05.06.2012 22:29
From pier
Thanks for the good intro! Thanks

permalink:  100   posted on 05.06.2012 10:33
From Rafael
Commenting post 96: I am starting to learn programing in Python and this is really good. Thanks a lot.

permalink:  99   posted on 05.06.2012 8:52
From silopolis
Commenting post 96: Hi, thanks for this intro.
Hardly waiting for next episodes ! :-)

permalink:  98   posted on 04.06.2012 24:53
From Yorik
Commenting post 97: As said in the article... You need a development version of wait for the new release (0.13)

permalink:  97   posted on 04.06.2012 24:35
From Steph
Commenting post 92: Hi...

Seem to be a nice job... but on wich version... version 0.12 for vista does not seem to those roof features...

in categories  opensource  freecad  linux  blender  permalink:  96   posted on 04.06.2012 21:06
From Yorik

Python for architects - Part 1: Introduction

This is a serie of 3 tutorials for architects who wish to use opensource 3D tools (mainly Blender and FreeCAD more effectively, or simply who are curious about programming, and would like a gentle introduction. This is the first tutorial, presenting python in a general way. The other parts (about Blender and FreeCAD) are yet to be written.

Why would I need to program? You might ask. There are a couple of reaons:

  • We architects are too dependents on big firms (Autodesk, Graphisoft, etc). They decide which tools, formats and standards we will use, and their decisions are in most cases dictated by commercial interests. We should be able to reflect and decide ourselves about how we want our work to be done, and have the power to craft our own tools if theirs are not good for us. Well, fear no more, yes we can!
  • Python is already included in many tools you know (or not): Blender, FreeCAD, Maya, Rhino, OpenOffice, and the crazy python fans everywhere even went much further, and you can now also use python in AutoCAD, 3ds Max or Revit, or Softimage. It also powers a very big part of Linux software. Python is everywhere. If you know one or another of those applications already, most of the work is already done. You'll just need a bit of python "sauce" to pilot them the same way as you already do with the mouse...
  • It is much easier than you would think. I'll try to demonstrate this below.

Why python?

Python is a programming language. It is free, open-source, multiplatform (Windows, Mac, Linux and many others), and it has several features that make it very different than other common programming languages, and very accessible to new users like yourself:

  • Python is a language described by its conceptors as "made for human beings", and is very easy to learn and understand. And even so (or, maybe, because of it), python is one of the most powerful languages available, principally because it can be (and is) extended almost infinitely, and is very, very widely used by people who are no computer scientists and never studied programming, like me.
  • It is interpreted, that is, unlike most other programming languages, it can be executed on-the-fly, as you write it. This has tremendous advantages for newcomers, for example it notifies you almost immediately when you make an error. You can start with very little knowledge, trying stuff, and in many cases it will teach you how to correct things and what to do next.
  • It can be embedded in other programs to be used as scripting language. Blender and FreeCAD have an embedded Python interpreter, so you can write Python code in them, that will manipulate parts of those programs, for example to create geometry. This is extremely powerful, because instead of just clicking a button labeled "create sphere", that a programmer has placed there for you, you have the freedom to create easily your own tool to create exactly the geometry you want.
  • It is extensible, you can easily plug new modules in your Python installation and extend its functionality. For example, you have modules that allow Python to read and write jpg images, to communicate with twitter, to schedule tasks to be performed by your operating system, etc. The list is endless. All this is easy to combine together, and use the power of one inside the other. For example, you can send tweets from blender, or create an openoffice sheet inside FreeCAD. You can even do incredible things such as running FreeCAD inside Blender (since FreeCAD is itself a python module too) and maybe the contrary too in the future...

So, hands on! Be aware that what will come next is a very simple introduction, by no means a complete python course. But my hope is that after that you'll get enough basics to explore deeper into the Blender and FreeCAD mechanisms, which will be in parts II and III of this tutorials serie.

Installing

Installing python present no difficulty at all, if you are on Linux there are 99% of chances that it is installed already, since it powers many parts of your system (try running "python" from a terminal to check), otherwise just install it from your system's package manager. On Windows and Mac, just download and install the latest version from the official python website. If you have Blender or FreeCAD installed, they already include an embedded python version, and you don't need to install anything.

When installing python, you might be able to choose between several versions. At the time of writing, the globally considered "stable" version is 2.7, but the latest version available is 3.2. I advise you to install the 3.2, or any higher version available. This tutorial is based on 3.2, but normally everything will work just the same with any other version.

The interpreter

Usually, when writing computer programs, you simply open a text editor (such as notepad on Windows) or a special programming environment which is in most case a text editor with several tools around it, write your program, then compile it (that means basically convert it into an executable application) and run it. Most of the time you made errors while writing, so your program won't work, and you will get an error message telling you what went wrong. Then you go back to your text editor, correct the mistakes, run again, and so on until your program works fine.

That whole process, in Python, can be done transparently inside the Python interpreter. The interpreter is a Python window with a command prompt, where you can simply type Python code, that will be executed on-the-fly, without the need to do anything else.

When Python is installed on your computer you will have a Python interpreter in your start menu (usually labelled "Python" or "Python console"). On linux and mac, you can also simply run "python" from a terminal window. Or, simply fire up Blender or FreeCAD, which both have an included python interpreter (also called "python console"). Below are images showing a standalone python console, and the python consoles embedded in FreeCAD and Blender:

The interpreter shows the Python version, then a >>> symbol, which is the command prompt, that is, where you enter Python code. Writing code in the interpreter is simple: one line is one instruction. When you press Enter, your line of code will be executed (after being instantly and invisibly compiled). For example, try writing this:

print("hello")

print is a special Python keyword that means, obviously, to print something on the screen. It is called a function, which means basically "it does something". Like in most programming languages, functions such as this one use parenthesis () that signify "do it with the contents of the parenthesis". So here the whole line means means "print the contents of the parenthesis". When you press Enter, the operation is executed, and the message "hello" is printed. If you make an error, for example let's write:

print(hello)

Python will tell us that it doesn't know what hello is: "NameError: name 'hello' is not defined".

The " characters specify that the content is a string, which is simply, in programming jargon, a piece of text. Without the ", the print command believed hello was not a piece of text but another special Python keyword. I'll explain better below. The important thing is, you immediately get notified that you made an error. By pressing the up arrow, you can go back to the last command you wrote and correct it.

The Python interpreter also has a built-in help system. Try typing:

help

It will tell us that help is a function, and needs to be used with parenthesis. For example, let's say we don't understand what went wrong with our print hello command above, we want specific information about the print command:

help(print)

You'll get a long and complete description of everything the print command can do. Press "Q" to exit the help message.

Now we dominate totally our interpreter (yes, there is no more to know than that), we can begin with serious stuff.

Variables

Of course, printing "hello" is not very interesting. More interesting is printing stuff you don't know before, or let Python find for you. That's where the concept of variable comes in. A variable is simply a value that you store under a name. For example, type this:

a = "hello"
print(a)

I guess you understood what happened, we "saved" the string "hello" under the name a. Now, a is not an unknown name anymore! We can use it anywhere, for example in the print command. We can use any name we want, just respecting simple rules, like not using spaces or punctuation. For example, we could very well write:

hello = "my own version of hello"
print(hello)

See? now hello is not an undefined word anymore. What if, by terrible bad luck, we choosed a name that already exists in Python? Let's say we want to store our string under the name "print":

print = "hello"

Python is very intelligent and will tell us that this is not possible. It has some "reserved" keywords that cannot be modified. But our own variables can be modified anytime, that's exactly why they are called variables, the contents can vary. For example:

myVariable = "hello"
print(myVariable)
myVariable = "good bye"
print(myVariable)

We changed the value of myVariable. We can also copy variables:

var1 = "hello"
var2 = var1
print(var2)

Note that it is interesting to give good names to your variables, because when you'll write long programs, after a while you won't remember what your variable named "a" is for. But if you named it for example myWelcomeMessage, you'll remember easily what it is used for when you'll see it.

Numbers

Of course you must know that programming is useful to treat all kind of data, and especially numbers, not only text strings. One thing is important, Python must know what kind of data it is dealing with. We saw in our print hello example, that the print command recognized our "hello" string. That is because by using the "", we told specifically the print command that what it would come next is a text string.

We can always check what data type is the contents of a variable with the special Python keyword type:

myVar = "hello"
type(myVar)

It will tell us the contents of myVar is 'str', or string in Python jargon. We have also other basic types of data, such as integer and float numbers:

firstNumber = 10
secondNumber = 20
print(firstNumber + secondNumber)
type(firstNumber)

This is already much more interesting, isn't it? Now we already have a powerful calculator! Look well at how it worked, Python knows that 10 and 20 are integer numbers. So they are stored as "int", and Python can do with them everything it can do with integers. Look at the results of this:

firstNumber = "10"
secondNumber = "20"
print(firstNumber + secondNumber)

See? We forced Python to consider that our two variables are not numbers but mere pieces of text. Python can add two pieces of text together, but it won't try to find out any sum. But we were talking about integer numbers. There are also float numbers. The difference is that integer numbers don't have decimal part, while foat numbers can have a decimal part:

var1 = 13
var2 = 15.65
print("var1 is of type ", type(var1))
print("var2 is of type ", type(var2))

Int and Floats can be mixed together without problem:

total = var1 + var2
print(total)
print(type(total))

Of course the total has decimals, right? Then Python automatically decided that the result is a float. In several cases such as this one, Python automatically decides what type to give to something. In other cases it doesn't. For example:

varA = "hello 123"
varB = 456
print(varA + varB)

This will give us an error, varA is a string and varB is an int, and Python doesn't know what to do. But we can force Python to convert between types:

varA = "hello"
varB = 123
print(varA + str(varB))

Now both are strings, the operation works! Note that we "stringified" varB at the time of printing, but we didn't change varB itself. If we wanted to turn varB permanently into a string, we would need to do this:

varB = str(varB)

We can also use int() and float() to convert to int and float if we want:

varA = "123"
print(int(varA))
print(float(varA))

Note on Python commands

You must have noticed that in this section we used the print command in several ways. We printed variables, sums, several things separated by commas, and even the result of other Python command such as type(). Maybe you also saw that doing those two commands:

type(varA)
print(type(varA))

have exactly the same result. That is because we are in the interpreter, and everything is automatically printed on screen. When we'll write more complex programs that run outside the interpreter, they won't print automatically everything on screen, (in fact, maybe they won't even have a screen to print to, if they run inside another application) so we'll need to use the print command. But from now on, let's stop using it here, it'll go faster. So we can simply write:

myVar = "hello friends"
myVar

Another cosmetic detail, you can insert blank spaces where you want, just to make your code easier to read. It's a matter of taste, python doesn't consider whitespaces (unless they are inside a string, of course, otherwise how would you print whole sentences?). For example, these two lines of code are totally identical to python:

print(type(varA+varB))
print ( type ( varA + varB ) )

Lists

Another interesting data type is lists. A list is simply a list of other data. The same way as we define a text string by using " ", we define lists by using [ ]:

myList = [1,2,3]
type(myList)
myOtherList = ["Bart", "Frank", "Bob"]
myMixedList = ["hello", 345, 34.567]

You see that it can contain any type of data. Lists are very useful because you can group variables together. You can then do all kind of things within that groups, for example counting them:

len(myOtherList)

or retrieving one item of a list:

myName = myOtherList[0]
myFriendsName = myOtherList[1]

You see that while the len() command returns the total number of items in a list, their "position" in the list begins with 0. The first item in a list is always at position 0, so in our myOtherList, "Bob" will be at position 2. We can do much more stuff with lists such as you can read here, such as sorting contents, removing or adding elements.

A funny and interesting thing for you: a text string is actually, internally, a list of characters! Try doing this:

myvar = "hello"
len(myvar)
myvar[2]

Usually all you can do with lists can also be done with strings. In fact both lists and strings are sequences of elements, and you can do much more with sequences, as we'll see further on.

Outside strings, ints, floats and lists, there are more built-in data types, such as dictionnaries, or you can even create your own data types with classes. Like everything in Python, the basics are small, but it is often extensible as far as your imagination allows.

Indentation & blocks

One big cool use of lists is also browsing through them and do something with each item. For example look at this:

alldaltons = ["Joe", "William", "Jack", "Averell"]
for dalton in alldaltons:
   print (dalton + " Dalton")

We iterated (programming jargon again!) through our list with the "for ... in ..." command and did something with each of the items. Note the special syntax: the for command terminates with : which indicates that what will comes after will be a block of one of more commands. Immediately after you enter the command line ending with :, the command prompt will change to ... which means Python knows that a :-ended line has happened and that what will come next will be part of it.

How will Python know how many of the next lines will be to be executed inside the for...in operation? For that, Python uses indentation. That is, your next lines won't begin immediately. You will begin them with a blank space, or several blank spaces, or a tab, or several tabs. Other programming languages use other methods, like putting everythin inside parenthesis, etc. As long as you write your next lines with the same indentation, they will be considered part of the same for-in block. If you begin one line with 2 spaces and the next one with 4, there will be an error. When you finished, just write another line without indentation, or simply press Enter to come back from the for-in block

Indentation is cool because if you make big ones (for example use tabs instead of spaces because it's larger), when you write a big program you'll have a clear view of what is executed inside what. We'll see that many other commands than for-in can have indented blocks of code too.

For-in commands can be used for many things that must be done more than once. It can for example be combined with the range() command:

serie = range(1,11)
total = 0
print ("sum")
for number in serie:
   print (number)
   total = total + number
print ("----")
print (total)

Or more complex things like this:

alldaltons = ["Joe", "William", "Jack", "Averell"]
for n in range(4):
   print (alldaltons[n], " is Dalton number ", n)

You see that the range() command also has that strange particularity that it begins with 0 (if you don't specify the starting number) and that its last number will be one less than the ending number you specify. That is, of course, so it works well with other Python commands. For example:

alldaltons = ["Joe", "William", "Jack", "Averell"]
total = len(alldaltons)
for n in range(total):
   print (alldaltons[n])

Another interesting use of indented blocks is with the if command. If executes a code block only if a certain condition is met, for example:

alldaltons = ["Joe", "William", "Jack", "Averell"]
if "Joe" in alldaltons:
   print ("We found that Dalton!!!")

Of course this will always print the sentence, because the stuff after "if" is always true ("Joe" is indeed foundin the allDaltons list), but try replacing the second line by:

if "Lucky Luke" in alldaltons:

Then the result of that line is false, and nothing is printed. We can also specify an else: statement:

alldaltons = ["Joe", "William", "Jack", "Averell"]
if "Lucky Luke" in alldaltons:
   print ("We found that Dalton!!!")
else:
   print ( "Such Dalton doesn't exist!" )

Functions

The standard Python commands are not many. In current version of Python there are about 30, and we already know several of them (print(), len(), type(), etc...). But imagine if we could invent our own commands? Well, we can, and it's extremely easy. In fact, most the additional modules that you can plug into your Python installation do just that, they add commands that you can use. A custom command in Python is called a function and is made like this:

def square(myValue):
    print ( str(myValue)+" square meters" )

print ( square(45) )

Extremely simple: the def() command defines a new function. You give it a name, and inside the parenthesis you define arguments that we'll use in our function. Arguments are data that will be passed to the function. For example, look at the len() command. If you just write len() alone, Python will tell you it needs an argument. That is, you want len() of something, right? Then, for example, you'll write len(myList) and you'll get the length of myList. Well, myList is an argument that you pass to the len() function. The len() function is defined in such a way that it knows what to do with what is passed to it. Same as we did here.

The "myValue" name can be anything, and it will be used only inside the function. It is just a name you give to the argument so you can do something with it, but it also serves so the function knows how many arguments to expect. For example, if you do this:

print ( square(45,34) )

There will be an error. Our function was programmed to receive just one argument, but it received two, 45 and 34. We could instead do something like this:

def sum(val1,val2):
   total = val1 + val2
   return ( total )

sum(45,34)
myTotal = sum(45,34)

We made a function that receives two arguments, sums them, and returns that value. Returning something is very useful, because we can do something with the result, such as store it in the myTotal variable. Of course, since we are in the interpreter and everything is printed, doing:

sum(45,34)

will print the result on the screen, but outside the interpreter, since there is no more print command inside the function, nothing would appear on the screen. You would need to do:

print (sum(45,34))

to have something printed.

Modules

Now that we have a good idea of how Python works, we'll need one last thing: How to work with files and modules.

Until now, we wrote Python instructions line by line in the interpreter, right? What if we could write several lines together, and have them executed all at once? It would certainly be handier for doing more complex things. And we could save our work too. Well, that too, is extremely easy. Simply open a text editor (such as the windows notepad, or gedit on ubuntu), and write all your Python lines, the same way as you write them in the interpreter, with indentations, etc. Then, save that file somewhere, with a .py extension instead of the usual .txt. That's it, you have a complete Python program. Of course, there are much better and much more comfortable editors than notepad (try notepad++ for example), but it is just to show you that a Python program is nothing else than a text file. Also note that on windows, python already comes with an editor named "IDLE", which is also a very comfortable way to write python code.

To make Python execute that program, there are hundreds of ways. In windows, simply right-click your file, open it with Python, and execute it. But you can also execute it from the Python interpreter itself. For this, the interpreter must find your .py file. The easiest way is to place your .py file in a place where python will search by default, such as the folder from where you started the python interpreter. On linux, by default it is your user home directory, on windows it is the folder where you installed python. If you use FreeCAD, you can simply place your .py file in the macros folder.

Here is a simple trick to find, from inside the python console, what is the current directory, which will be a good place to save our script (I'll explain later):

import os
os.path.abspath(".")

Then, let's fire our text editor, and write the following text:

def sum(a,b):
    return (a + b)

print( "test.py succesfully loaded" )

and we save it as test.py in the directory found above. Now, let's start our python console, and, write:

import test

without the .py extension. This will simply execute the contents of the file, line by line, just as if we had written it in the interpreter. The sum function will be created, and the message will be printed. There is one big difference: the import command is made not only to execute programs written in files, like ours, but also to load the functions inside, so they become available in the interpreter. In python, that kind of files, made to be imported into other files instead of being simply executed, are called modules.

Normally when we write a sum() function directly in the interpreter, we execute it simply like that:

sum(14,45)

Like we did earlier. When we import a module containing our sum() function, the syntax is a bit different. We do:

test.sum(14,45)

That is, the module is imported as a "container", and all its functions are inside. This is extremely useful, because we can import a lot of modules, and keep everything well organized. So, basically, everywhere you see something.somethingElse, with a dot in between, that means somethingElse is inside something. Now you should understand better what we did with our "os" module above. The os module is a standard module of python, and contains operating system-related functions, and a submodule (simply a module inside a module) named "path" which contains tools to work with files and folders.

We can also throw out the test part, and import our sum() function directly into the main interpreter space, like this:

from test import *
sum(12,54)

Basically all modules behave like that. You import a module, then you can use its functions like that: module.function(argument). Almost all modules do that: they define functions, new data types and classes that you can use in the interpreter or in your own Python modules, because nothing prevents you to import modules inside your module!

One last extremely useful thing. How do we know what modules we have, what functions are inside and how to use them (that is, what kind of arguments they need)? We saw already that Python has a help() function. Doing:

help()
modules

Will give us a list of all available modules. We can now type q to get out of the interactive help, and import any of them. We can even browse their content with the dir() command:

import math
dir(math)

We'll see all the functions contained in the math module, as well as strange stuff named __doc__, __file__, __name__. The __doc__ is extremely useful, it is a documentation text. Every function of (well-made) modules has a __doc__ that explains how to use it. For example, we see that there is a sin function inside the math module. Want to know how to use it?

print ( math.sin.__doc__ )

which is a simpler version than:

help(math.sin)

And finally one last little goodie: When we work on programming a new module, we often want to test it. So once we wrote a little piece of module, in a python interpreter, we do something like this, to test our new code:

import myModule
myModule.myTestFunction()

But what if we see that myTestFunction() doesn't work correctly? We go back to our editor and modifiy it. Then, instead of closing and reopening the python interpreter, we can simply update the module like this:

reload(myModule)

Conclusion

By now, you should have a broad idea of how things are programmed in python. As you see, it's basically a matter of writing text files containing your python instructions, and have these files (modules) imported in your favorite application, and executed for example when the user pushes a button. How to achieve that depends from the application, that's what we'll explore in the next parts of this tutorials serie...

In the meantime, if you would like to know more about the basics of python, there are many, many tutorials on the internet. I selected a couple of good, simple and easy ones here. For more advanced ones, just google for "python tutorial", and you'll find plenty, including one from the official python website.

There are also many very complete PDF ebooks:

I hope you liked, if anything is unclear, please tell me by posting a comment below, so I can make it evolve into something better!

To be continued!


permalink:  95   posted on 03.06.2012 3:38
From Yorik
Gracias a todos! Espero tener más en breve...

permalink:  94   posted on 03.06.2012 2:16
From Warcos
Commenting post 92: se ven bastante bien los avances...
conocia poco sobre FreeCAD, pero ya estoy empezando a utilizarlo...

permalink:  93   posted on 02.06.2012 24:03
From Rafael
Commenting post 92: Amazing work! It is incredible how are you creating your own digital tools. Extraordinary!

in categories  freecad  opensource  permalink:  92   posted on 01.06.2012 16:49
From Yorik

FreeCAD Arch module development status


There is quite some time I didn't write about what's going on with the FreeCAD Arch module development, so here it goes. Keep in mind that all this is still in heavy development, so it will only be available in next release (unless you use a development version of course!) and it still has many bugs. Even so, I think there is some interesting stuff to show...

The first main improvement is not in the Arch module itself but in the Draft module. The whole snapping system has been fully redone, and now features proper and extensible API and interface, clear icons, and a control toolbar. The Draft snap system is used by all Draft commands and by the Arch Wall tool, which is at the moment the only tool which has a drawing system.



The Arch Wall tool has been redone too. You have now 2 ways to make a wall: Either by selecting a 2D shape (wire, sketch, etc...) and pressing the Wall button, in which case the new wall will take the selected object as baseline, or without anything selected. In the latter case, you enter a wall drawing mode, where walls can be drawn as easily as lines.



Walls also have a new way to connect to each other, and will now auto-connect when you snap to an existing wall segment. This is done in 2 manners: If both wall segments have same width, height and alignment, the baseline of the new segment is simply added to the base sketch of the existing segment. If not, then the new wall receives its own base sketch, and it is added to the existing wall as addition.

The window tool has also been completely redone. Windows can now only be created on top of an existing 2D object (draft or sketch). Which leads to the extremely intuitive new way to make windows in FreeCAD: Draw them directly on the walls!



The technique is simple, you must simply draw a sketch with a serie of closed wires. Then these wires can be used to define window parts (frames, panels, etc...). When pressing the window button, a default window is created, with a default window part, by subtracting the inner wires from the biggest one. you can then edit these window parts, add new ones, etc... By double-clicking the window object in the tree.

The windows also automatically create a hole in the walls they are inserted in. To insert a window in a wall, select the window and the wall, and press the Arch Subtract button. If you create a window with another window selected, you'll create a clone of that window, which can be moved and inserted in other walls, but keeps the same shape of the base one.

Another new tool that has been added is the Arch Roof tool. It works only with a face selected. It then creates a sloped roof on top of that face. You can change the slope angle in its properties. It is still bery basic, all panes have the same angle, and it fails in many complex cases such as angles different than 90°, but for most roofs it already works pretty well:



The Arch group objects (floor, building, site) are also being reworked, and are now based on FreeCAD group objects, which means you can drag&drop to/from them in the tree.

And finally, I also did some further work in the Vector renderer and the Drawing module. The vector renderer is getting more stable, and is now able to work with rather complex models without errors (although it is beginning to be slow... It might be time to redo it in C++ soon). The Drawing workbench also has a new clip object, which can be used to clip a Drawing view to a certain rectangle.



We're now slowly going towards next release, so I think most of my efforts until then will go into bugfixing rather than adding new features. Anyway, I believe we're kind of reaching a state where it begins to be possible to do quite complex architecture models already. I'll try to post some examples soon...

permalink:  91   posted on 31.05.2012 20:20
From Yorik
Commenting post 90: Hi Duncan,
Until now it's still Draftsight... Hope to switch to FreeCAD fully one day, but we still need a bit of patience...

permalink:  90   posted on 31.05.2012 19:39
From Duncan
Commenting post 28: What software have you used here to produce the working drawings?

permalink:  89   posted on 28.05.2012 14:38
From Yorik
Commenting post 88: Hi Rudolf,
Indeed there are no tools to do that at the moment, I think... The dxf exporter was never able to do that anyway, only export geometry as 2D entities, without any "rendering" effect. I'm currently working on something like that for FreeCAD ( http://yorik.uncreated.net/guestblog.php?2012=54 ) but there is still some work needed before it's totally functional. I would say, in the meantime, your best option would be to use sketchup ( http://yorik.uncreated.net/guestblog.php?2011=57 ), or maybe have a look at freestyle ( http://freestyleintegration.wordpress.com/ ), which has SVG export functionality... But in that case, I think you'll need to do the cut by hand (subtract a bigger volume)

permalink:  88   posted on 27.05.2012 15:05
From Rudolf
Hey Yorik

I'm trying to export a dxf sectional perspective line drawing from blender. Do you know how to do this? The 2.49 version exports basically a wireframe whereas I want a "flatshot" perspective with the everything not visible culled. As far as I'm aware the dxf tools on 2.6x are as yet not functional.

permalink:  87   posted on 26.05.2012 15:54
From Yorik
Commenting post 86: Hi Davis,
Thanks! The 2D trees are put directly in Blender, on vertical planes that follow the camera... Have a look at this file for example, you'll see how it's all done: http://www.4shared.com/file/BXwxPRB4/tamarineira17packed.html

permalink:  86   posted on 25.05.2012 20:47
From Davis Msumba
Commenting post 105: I really like your work, design and rendering. Am an architectural trainee in Africa and would like to know how to produce images of this quality. Am self learning blender now but I wonder how you put those 2d trees in this document. Did you use blender only od with other softwares? which software did you use an open sourced or a commercial one?

permalink:  85   posted on 22.05.2012 23:11
From Yorik
Commenting post 84: It works on 2.63 already... I had to do a small adaptation for bmesh, I don't know if the version in blender contrib scripts is updated already. But in any case you can get it from here:
http://projects.blender.org/tracker/?func=detail&aid=26997&group_id=153&atid=468

permalink:  84   posted on 22.05.2012 22:54
From Dennis
Commenting post 73: This is a very cool script - too bad it's not working at 2.63. Would be too cool to have this as a realtime modifier

in categories  works  3d  sketches  permalink:  83   posted on 18.05.2012 16:19
From Yorik

Hand rendering, and cycles test


A hand rendering I did for a house by Adriana Furst. Below is also a little test with the cycles renderer. Doing exterior lighting with cycles is a bit tricky, but it can surely give amazing results, I need to try more...




permalink:  81   posted on 18.05.2012 15:27
From KoDE
Commenting post 105: Very nice!

in categories  works  detail  permalink:  80   posted on 17.05.2012 16:02
From Yorik

Factory execution project


The factory project we've been doing with Mário Francisco Arquitetura is finally out. Here go a sample of the execution drawings...




















permalink:  79   posted on 16.05.2012 24:39
From Yorik
Commenting post 78: There is no schedule... At the moment, the FreeCAD motto is basically "It's done when it's done". But there are many ways to get previews at upcoming versions...

permalink:  78   posted on 16.05.2012 23:47
From Rafael
When are you planing to release the next version of FreeCAD?

in categories  linux  opensource  permalink:  77   posted on 16.05.2012 21:06
From Yorik

Ubuntu-style toolbar close buttons for fluxbox

It's pretty simple, really... Fluxbox has a "fluxbox-remote" tool that can be used to send commands to fluxbox, such as "Close" or "Fullscreen". So the trick is simply to add launchers to your taskbar (in this case fbpanel) and set "fluxbox-remote Close" or any other as their command line:



in categories  freecad  permalink:  76   posted on 16.05.2012 20:51
From Yorik

Clipping planes on FreeCAD drawing sheets



I added a new object type for the Drawing module of FreeCAD. It is a clip plane object, it behaves like a group, you can place it inside a page (which happens by default when pressing the button), and add view objects to it by dragging them in the tree view. It has X, Y, Width and Height properties so you can define the viewport precisely, and a "show frame" property which can be used to see a red border around the frame, useful to place it correctly.

The clip object then simply clips all the view objects contained in it, without any further transformation.



The bottom view shows the 3D view with a wall and a section plane object, the top right window shows the current Qt-based Drawing viewer. Due to the internal limitations of the Qt svg engine, it cannot represent the svg clip object correctly. But the webkit viewer (left image), which will be used by default once we find time to do so, shows it correctly, as well as other svg applications.

permalink:  75   posted on 14.05.2012 1:49
From Rafael
Commenting post 74: wow, men. You are my hero... I wan to be like you when adult.

in categories  freecad  permalink:  74   posted on 14.05.2012 1:24
From Yorik
Experimenting with roof-generation scripts in FreeCAD...


in categories  opensource  linux  permalink:  73   posted on 10.05.2012 1:26
From Yorik

Whiteaway fluxbox theme





This is a new fluxbox theme I made, with matching gtk3 and qtcurve themes. Download from http://yorik.uncreated.net/scripts/themes/whiteaway.zip

in categories  photo  permalink:  72   posted on 08.05.2012 23:02
From Yorik
Virada cultural 2012, São Paulo without cars...


permalink:  71   posted on 08.05.2012 16:54
From Yorik
Commenting post 70: Hi Gudeta,
There are indeed a lot. For me the more powerful is Qt (PyQt or PySide), but it's not the easiest. For something simple, I would definitely try zenity ( http://en.wikipedia.org/wiki/Zenity )... It is used all around ubuntu, and looks really simple to use.

permalink:  70   posted on 01.05.2012 10:37
From Gudeta
Hi Yorik,

Glad to see the continued development of freecad, I am liking python coding stuff and I am going to ask you an off topic question if you don't mind.
I was planning to create a little python gui with a text box and a button to take that text and pass it to a commanline program - espeak-to convert it to speech.
while googling i saw there are a lot of gui options for python, which one do you recommend for a beginner,
ps. i would like to deploy the outcome on windows.

Thanks a lot,

permalink:  69   posted on 30.04.2012 20:28
From Yorik
Commenting post 68: Fixed!
Next time, can you use the freecad bug tracker? It makes it easier for me...
http://sourceforge.net/apps/mantisbt/free-cad/
Thanks!

permalink:  68   posted on 30.04.2012 15:33
From anh
Would you check the function makeDimension of the file Draft.py please,

Following script, for example:

import Part, math, Drawing, Draft
from FreeCAD import Base
App.newDocument()
Circle=         Part.makeCircle(100,Base.Vector(0,0,0),Base.Vector(0,0,1),0,115)
obj=            App.activeDocument().addObject('Part::Feature','Circle')
obj.Shape=      Circle
rdim=           Draft.makeDimension(obj,0,"radius",obj.Shape.Vertexes[0].Point)

outputs:

--------------------
Traceback (most recent call last):
  File "input", line 1, in 
  File "/usr/lib/freecad/Mod/Draft/Draft.py", line 465, in makeDimension
    obj.ViewObject.Override = "rdim"
AttributeError: 'Gui.ViewProviderPythonFeature' object has no attribute 'Override'
--------------------

Commeting out both the lines 465 and 468 works fine.
Furthermore, makeDimension(p1,p2,p3,p4) does not work for each p4, in case p3== "radius" or p3=="diameter". For example:

rdim=           Draft.makeDimension(obj,0,"radius")

outputs:
-----------------------
Traceback (most recent call last):
  File "input", line 1, in 
  File "/usr/lib/freecad/Mod/Draft/Draft.py", line 471, in makeDimension
    p3 = p2.sub(p1)
AttributeError: 'int' object has no attribute 'sub'
-----------------------

or with the script:

rdim=           Draft.makeDimension(obj,0,"radius",Base.Vector(0,0,0))

no dim can displayed (it is greyed out).
Thanks.

anh

Dell Latitude D430
Ubuntu 10.04
FreeCAD 0.13R0784
Release date: 25.03.2012, 13:38:32

permalink:  67   posted on 27.04.2012 13:37
From Yorik
Commenting post 66: Hi anh,
This is fixed now. Thanks for notifying!

permalink:  66   posted on 27.04.2012 8:41
From tuan anh, vu
Hi Yorik,

would you check the line 1777 in the file Draft.py ?

Calling, e.g. Draft.makeDimension(Base.Vector(0,0,100),Base.Vector(0,10,100)) outputs:
Traceback (most recent call last):
  File "input", line 1, in module
  File "/usr/lib/freecad/Mod/Draft/Draft.py", line 474, in makeDimension
    _ViewProviderDimension(obj.ViewObject)
  File "/usr/lib/freecad/Mod/Draft/Draft.py", line 1777, in __init__
    obj.DisplayModes = ["2D","3D"] #obj.DisplayModes
AttributeError: 'Gui.ViewProviderPythonFeature' object has no attribute 'DisplayModes'
Change to obj.DisplayMode= ["2D","3D"] works for me.

Thanks

anh
Dell Latitude D430
Ubuntu 10.04
FreeCAD 0.13R0784, Release date: 2012/04/25 13:38:32

permalink:  65   posted on 25.04.2012 7:27
From Anthony
Hi Yorik,
Yes, you are right, I just want to use the dxf file in importing it in DraftSight in doing the Construction Drawings. I just want to adopt free CAD related applications in my drawing workflow, DraftSight, Blender, SketchUp, Gimp, and Inkspcape to name a few. Your site really helps. Maraming Salamat Yorik (Thank you very much).

permalink:  64   posted on 22.04.2012 17:13
From Yorik
Commenting post 63: Hi Anthony,
It depends much on what you intend to do... simply "converting a blender object to dxf" might not be possible or give you results very different than what you want to obtain, since there are many ways to write data in dxf, and 3D is hard to support. It is definitely no simple question.

From your post I believe you want to obtain 2D views of your 3D model, right? For me at the moment the best method is this: http://yorik.uncreated.net/guestblog.php?2011=57 then from inkscape you can export as dxf too...

permalink:  63   posted on 22.04.2012 5:12
From Anthony
Yorik, good evening. How do you convert a blend 2.6 file into dxf file? I read some articles that it can be done using 2.49. But I don't want to use 2.49 though. Last night, I started getting my fingers dirty with DraftSight. For 3d modeling and rendering, I've wanted to use Blender. I've wanted to use free software in the drafting drafting works the way you do it. Thanks, any reply is appreciated.

in categories  sketches  permalink:  61   posted on 17.04.2012 19:36
From Yorik
Fluffy the attack dog


in categories  inthepress  permalink:  60   posted on 12.04.2012 4:14
From Yorik
Seems I'll be at the FISL!

http://softwarelivre.org/fisl13/convidados

permalink:  59   posted on 08.04.2012 15:25
From Yorik
Commenting post 58: No plugin... My site/blog is 100% custom php code, made by myself... I make those thumbnails by hand with the gimp

permalink:  58   posted on 08.04.2012 4:25
From Brent
Hey, might I ask which plugin you use to generate the thumbnails on your index page?

permalink:  56   posted on 04.04.2012 2:56
From Rafael
Commenting post 54: Great work! Congratulations to improve more and more this amazing software.

in categories  freecad  opensource  permalink:  54   posted on 03.04.2012 21:21
From Yorik

Vector renderer for FreeCAD


The OpenCasCade kernel of FreeCAD already provides a way to project 3d objects on a 2d plane. That is what we use now in the Drawing module. But it does it by calculating the shown and hidden segments of the object's edges, and can only output a bunch of lines. Nice for simple views, but not enough for architecture documents, where we want to be able to "paint" our 2d areas with solid or hatch fills.

So I ended up writing a complete new vector rendering module, inspired by earlier experiments for blender such as Pantograph or VRM. Both are based on the Painter algorithm, which is a way to render objects by depth order, so the upper objects hide the lower ones.

SVG works exactly that way, so it is totally appropriate. The big problem is to sort the faces of 3D objects by their depth in relation to the point of view. It may look simple, but it is a quite complex problem, you cannot simply consider the faces centerpoint, you need to do a serie of tests to know which face is closer. Finally, I found this article that explains step-by-step several tests to do. I implemented this in a new module and it works already fairly good and fast:



The Arch section plane already uses it by default:



Of course this is still preliminar work and will probably fail in many complex cases, but I'm already pretty happy to have the main algorithm working.



Preliminary sections support is also working:


permalink:  53   posted on 30.03.2012 3:28
From bouba
Hello,

I just wanted to thank you for the plants models your are providing. Its really a great job! Thank you very much :-)

in categories  detail  works  permalink:  52   posted on 26.03.2012 21:22
From Yorik

House transformation project



A little house project by Ferraz & Santa Cruz architects, where we made the execution drawings:










permalink:  51   posted on 25.03.2012 16:09
From Yorik
Commenting post 50: But don't worry, sooner or later, the FreeCAD era will begin

permalink:  50   posted on 25.03.2012 12:36
From brandon
ahh... the mighty draftsight thanks yorik for your answers. I am both amazed and confused why your outputs and achievements are so good.

in categories  blender  permalink:  49   posted on 24.03.2012 16:23
From Yorik
Matching colors to a photograph...


permalink:  48   posted on 22.03.2012 14:39
From Yorik
Commenting post 47: In this one no, we used draftsight. We are working with other architects, so we can't go very "exotic"...

permalink:  47   posted on 22.03.2012 14:16
From brandon
Commenting post 28: Wow! A fast reply Thanks.
I realized... I should have have asked what "autocad-like" software have been used?
Was this already a product of the very promising FreeCAD?

permalink:  46   posted on 21.03.2012 13:29
From Yorik
Commenting post 45: Hi Brandon,
It's 100% blender. Blender renders quite well the 2D geometry that you import from dxf files... You just give it a "wire" material and that's done!

permalink:  45   posted on 21.03.2012 12:25
From brandon
Commenting post 28: Hi Yorik. I'm very excited to know what software was used to model and render this.
How was image number 3 done? Those column and row labels are very neat. Is it from freecad?

in categories  freecad  linux  opensource  permalink:  44   posted on 21.03.2012 3:20
From Yorik

FreeCAD thumbnailer for KDE





After the tumbler plugin, here is now a KDE plugin (for the dolphin file manager) that will show thumbnails for FreeCAD .Fcstd files. Enjoy!

http://github.com/yorikvanhavre/kde-fcstd-thumbnailer

in categories  trilhas  permalink:  43   posted on 21.03.2012 2:54
From Yorik

Trilha do bonete, Ilhabela, SP - 15km




Ver esta trilha no Google maps

Comprimento: 15km
Dificuldade: média

Esta é uma das trilhas mais bonitas que já fiz no Brasil. Passa por várias cachoeiras, rios, e acaba numa praia que é um canto de paraíso. Demora umas 5 horas para percorrer, contando umas paradas de meia-hora nas cachoeiras (leve protetor anti-mosquitos). O ônibus "Borrifos" leva ao início da trilha, os primeiros 3 km são de estrada de chão, depois começa a trilha mesmo. É bem aberta e muito fácil de seguir, tem algumas passagens um pouco cansativos mas nada de muito difícil. A trilha passa por várias paisagens diferentes e vistas incríveis sobre os morros, rios, pedras, cachoeiras, mar, mato, etc... e acaba na praia do Bonete, que não é acessível de carro. Ali tem uma pequena comunidade de pescadores, e algumas pousadas e restaurantes.

Se consegue muito facilmente um barco para voltar para o Borrifos (cobram R$ 50 por pessoa atualmente) falando com o pessoal lá. Já para ir de barco e voltar a pé é mais difícil (ou mais caro), pois não tem sempre barcos no borrifos








in categories  trilhas  permalink:  42   posted on 21.03.2012 2:43
From Yorik

Trilha: Praia da Jabaquara, Ilhabela, SP - 8km




Ver esta trilha no Google Maps

Comprimento: 8km
Dificuldade: fácil

Esta não é realmente uma trilha, é uma estrada de chão. Mas passadas as casas nos primeiros 2 ou 3 km, o caminho é lindo, e praticamente não passa carro nenhum. A trilha conduz a duas praias, a primeira sendo totalmente deserta, a segunda com alguns barzinhos. Ambas tem água bem calma. O ônibus "Armação" vai até o início da estrada de chão, depois tem 3 km até a primeira praia, e mais 5 até a segunda.

Como o caminho é muito fácil, da tranquilamente para ir de chinelos (fora o fato que são 16km ida e volta)...








in categories  sketches  permalink:  41   posted on 20.03.2012 23:04
From Yorik

in categories  sketches  permalink:  40   posted on 19.03.2012 24:18
From Yorik

permalink:  39   posted on 16.03.2012 1:55
From Yorik
Commenting post 38: For windows I think it is working already? (Werner did it if I remember well), for dolphin I might try, if I find the correct specifications...

permalink:  38   posted on 15.03.2012 23:01
From Petar
Commenting post 37: Is there plugin for win or dolphin (KDE)? Are they planned?

in categories  linux  freecad  opensource  permalink:  37   posted on 15.03.2012 20:38
From Yorik

FreeCAD plugin for tumbler





Tumbler is a rather new thumbnailing system developed by the people at xfce. It is used by thunar and marlinn file managers. I just made a plugin for tumbler that allows it to display thumbnails for FreeCAD files (provided you enabled thumbnails in the FreeCAD preferences).

Get the code here: https://github.com/yorikvanhavre/tumbler-fcstd-thumbnailer.

I plan to include this in the FreeCAD sources or the tumbler sources, depending if the xfce devs find it useful

in categories  sketches  permalink:  30   posted on 11.03.2012 19:45
From Yorik

in categories  photo  permalink:  29   posted on 10.03.2012 20:28
From Yorik

Ilhabela




in categories  works  detail  3d  projects  permalink:  28   posted on 09.03.2012 16:44
From Yorik

Factory design


A proposal for a factory we recently did with arch Mário Francisco. The project is now on the rails and we're doing the execution documents. More to come...

















More detalis and execution drawings here.

in categories  works  sketches  permalink:  27   posted on 07.03.2012 14:57
From Yorik
residencial hand renderings





Project by Adriana Furst.

in categories  freecad  permalink:  26   posted on 28.02.2012 13:55
From Yorik

permalink:  25   posted on 16.02.2012 13:42
From Porfirio Franco Vaz Pontes (Franco)
Bom dia, bonjour! (je suis portugais vivant en France)

En cherchant des exemples de rendus 3d sur Blender, je suis tomber sur vos tutoriels et vote site. Parabéns!!! Très interressant. Je suis architecte moi-même et je débute dans la 3d sur blender. En fit, je souhaite maitriser rapidemant ce logiciel, + gimp pour réliser de vues 3d convainquantes (même si mon patron n'est pas Mario Botta!!) Enfin, je travail essentiellement sur autocad et revit.
Merci et... Bom dia!

Franco

permalink:  24   posted on 13.02.2012 23:59
From Pepper
Commenting post 23: This so needs to be called "Mint extract" XD

in categories  linux  opensource  permalink:  23   posted on 13.02.2012 16:50
From Yorik

Mint without Mint





I always like Linux Mint's desktop design, but am too lazy to abandon my debian testing system... So here is a "linuxmint-like" theme on debian testing. All you need to do is to get Mint's icon theme and wallpapers packages (they are multi-arch and don't depend on any other package):

http://packages.linuxmint.com/pool/main/m/mint-x-icons/mint-x-icons_1.0.7_all.deb
http://packages.linuxmint.com/pool/upstream/m/mint-wallpapers/mint-wallpapers_9.0.2_all.deb

I also made matching fluxbox, qtcurve, gtk2 and gtk3 themes here (all is explained in the archive's readme file):

http://yorik.uncreated.net/scripts/themes/greenaway.zip

permalink:  22   posted on 09.02.2012 23:39
From Yorik
@Tom Svilans

Indeed there are many bugs and cases where it doesn't work, the thing is I use it in 99% of the cases in totally straight, orthogonal situations where it works OK... Indeed those could be good improvements, but I'm not too sure when I'll have time to work on that...

@I am

the freecad import script doesn't work anymore at the moment because freecad doesn't support python3 yet... The day it does, I'll surely make it support anything I can

permalink:  21   posted on 09.02.2012 20:37
From I am
Commenting post 105: It coming all features for blender? Examples pocket features?

permalink:  20   posted on 08.02.2012 18:41
From Tom Svilans
Commenting post 73: Hey,

First off, thank you very much for porting this. It's very useful and I've been missing it since 2.49b!

The most obvious bug is the interior faces that it generates even with simple edges. If you look at the little cubes, they often have interior faces that screw up normals and subD modifiers.

Also, would it be possible to have an option to add an extra edge loop right before each junction? Helps so that when you subD the whole thing, the joints are tighter and it retains its form better.

Orientation of the junction cubes is a bit too uniform and sometimes leads to funny results, where the edge is 'stepped'. I know it's probably because it's easier and quicker to put the junction cubes in a single orientation, but having them adapt to the input edge angles would be awesome to make a smoother result.

Once again, thanks!

in categories  3d  permalink:  19   posted on 29.01.2012 18:32
From Yorik

Gusteau's kitchen


This scene from Pixar's Ratatouille animation leaked on cgtalk the other day (several formats available, including blender), for your lighing experiments pleasure. This was done with blender internal renderer...


permalink:  18   posted on 16.01.2012 4:31
From Rafael
Commenting post 17: Great work. Go ahead!!

in categories  freecad  opensource  permalink:  17   posted on 15.01.2012 22:29
From Yorik

IfcOpenShell and FreeCAD to work with BRep solids



With Thomas Krijnen, the guy behind IfcOpenShell, we've been playing with importing BRep files, the native OpenCasCade geometry format, from IfcOpenShell to FreeCAD. This gives truly spectacular results, FreeCAD being able to import a whole IFC file as Part solids, thus skipping the whole Mesh-to-Solid operation.



This is of course just a very early step in making the imported IFC files into something usable "architecture-wise", but it is an important one. Part shapes are the true main building block in all FreeCAD, and being able to import data in its native format is of a considerable importance to maintain a good data integrity. I also think it is a significant step in the OCC-based ecosystem...

permalink:  16   posted on 12.01.2012 15:36
From Yorik
Commenting post 14: Indeed, it's hight time I do that...

in categories  freecad  opensource  permalink:  15   posted on 12.01.2012 15:36
From Yorik
follow-up to post 13...

The Structure elements can now be based on 2 axes systems. In edit mode, you can add axes system to a structure element. When you have 2 or more axes systems, the structual elements are placed on every intersection point. Currently only takes the 2 first axes into account...


permalink:  14   posted on 10.01.2012 23:01
From Rafael
Commenting post 13: greate!! it sounds good. I think that we need a tutorial for Arch module.

in categories  freecad  opensource  permalink:  13   posted on 10.01.2012 21:29
From Yorik

Axes systems in FreeCAD


I more or less finished an axes system for the Arch module. It is a simple, 1-dimension axes system. You can specify the length of the axes, the size of the numbering bubble, and the numbering style (1,2,3,... or A,B,C, etc. Several styles available) directly via the properties. Then, via edit mode (double-clicking on the object in the Tree view), you can refine the whole axes sequence, by adding and removing axes, and changing the interval distance and angle of each axis. They are also movable and rotationable, so you can create very complex axes systems, which are totally snappable, including to the intersections.



Later on I plan to use them for laying out the levels of a multi-floor construction too, creating true 3-dimension systems, and find a way to have structural elements bound to them, so you can parametrically stretch buildings only by modifying their axes systems.

permalink:  12   posted on 10.01.2012 21:25
From Hisao Ishida - Av. Adoniran Barbosa, Pq. Novo Horizonte
Commenting post 160: Belo projeto. Parabéns aos empreendedores.

permalink:  11   posted on 10.01.2012 21:21
From Yorik
Commenting post 10: Hi Rafael,
You are probably right, indeed she also refers to other projects of the same kind... Thanks for correcting

permalink:  10   posted on 10.01.2012 5:29
From Rafael
Commenting post 7: I think that Raquel Rolnik said "tosco" because is talking about the whole process (not about its architectural design). The political actions of the authorities would be rude, and not transparent.

permalink:  9   posted on 09.01.2012 19:46
From Yorik
Commenting post 5: Hi,
Only 2D objects (Draft and Sketches) have no "shaded" display mode... since it is mostly linework, it doesn't make much sense otherwise... What you can always do is embed them in a full shape object (for example using the scale tool and maintaining the scale at (1,1,1)

permalink:  8   posted on 09.01.2012 19:43
From Yorik
Commenting post 6: Hi,

Indeed the wiki it referred to doesn't exist anymore. All textures are on this site too:
http://yorik.uncreated.net/archive/textures/
But indeed I should update the links on the greenhouse page. Thanks for notifying!

in categories  Architecture  permalink:  7   posted on 09.01.2012 16:59
From Yorik

Análise do projeto nova luz

Tem no momento várias controversas em volta do projeto Nova Luz, no centro de São Paulo. O projeto visa a reformar um grande pedaço do centro, entre a Santa Ifigênia e a Luz, que é considerada uma região com potencial sub-aproveitado, isso é, que é importante porque é no centro, e poderia ajudar a redinamizar a área central toda, mas para isso deveria ter mais moradores, ou seja, mais pessoas "fixas", que ficam ali fora do horário comercial.

A objeção principal é que essa reforma vai desapropriar muita gente e que vários outros não conseguirão mais morar ali, porque o bairro vai "gentrificar", isso é, gente com mais dinheiro vão passar a morar ali e transformar tanto o bairro que vão acabar expulsando os moradores de baixa renda atuais. Também tem sérias objeções contra o mecanismo legal e imobiliário atrás desse projeto.

Tentei analisar o projeto, disponível na integra aqui, e as objeções que tem contra ele, principalmente este vídeo, e construir uma opinião mais justa possível. Contudo, é apena minha opinião, vale o que vale (não muito).

  • Primeiramente, olhei o projeto. O projeto e bastante bom. Não consigo entender porque a Raquel Rolnik chama ele de "tosco" no vídeo. Ele faz uma análise bem completo da situação existente, prevê coisas essenciais como infraestrutura, escolas e outros equipamentos públicos, prevê áreas que deverão ser mantidas acessíveis para pessoas de baixa renda (aluguel baixo, etc), e tem um monte de ideias interessantes como ruas permeáveis, quarterões que podem ser atravessados livremente por pedestres, ciclovias, praças bastante bem projetadas, etc. Francamente, boa sorte para fazer um projeto melhor. Pelo menos as propostas alternativas que vi até agora, como esta, não me parecem propor algo muito diferente...
  • Discordo de uma outra coisa que falam tanto no vídeo como em vários lugares da internet, que é que ali não deve ter um projeto de referência "internacional" mas sim de referência "brasileira". É claro que na arquitetura e no urbanismo tem uma parte local. Tem coisas que se fazem na Suécia que não podem nem devem ser feitas na Indonésia, todo mundo entende isso. Mas a arquitetura também tem uma parte universal. Porque um Indonésio não teria direito às mesmas condições que um Sueco? Por acaso o Sueco tem necessidades diferentes? Deve viver em uma cidade diferente? Acho que São Paulo é uma cidade de porte mundial, e podemos sim comparar as soluções propostas aqui com o que se faz em megalópoles similares ao redor do mundo, sem por isso descartar o lado local. Acho que a grande maioria dos urbanistas no Brasil como no resto do mundo sabe perfeitamente fazer essa distinção. Pelo menos, nesse projeto, não achei nada que me pareça inaplicável em São Paulo...
  • Aparentemente, a coisa principal que foi pedida aos autores do projeto foi: "Precisamos que vocês aumentem muito o número de moradores ali". Nessa questão também o projeto responde bem: Todos os números dobram, mas o "mix", a proporção entre moradores de renda baixa, moradores de renda alta, trabalhadores, comércio, continua a mesma. A área disponível para moradia (a área total de apartamentos) dobra também. Resumindo, o projeto faz o que foi pedido mas cuida em manter a diversidade atual da população do centro. Achei isso uma atitude muito correta.
  • Sobre a necessidade de aumentar a população dessa área, também acho válido. O centro de São Paulo carece de moradores. Como muitas áreas centrais de cidades grandes, ele foi totalmente "tomado" por comércios e escritórios, e hoje tem pouca gente demais morando la, e, a noite, as ruas esvaziam muito. Como ensina a Jane Jacobs, provavelmente a maior especialista que já teve sobre esse fenômeno, é fundamental ter moradores para ter um bairro equilibrado e seguro. Fazer isso na Luz realmente poderia ter um impacto enorme sobre toda a área central, e fazer com que o centro volte a ser habitado, e vire um pedaço de cidade equilibrado, seguro e dinâmico.
  • Sobre como o projeto responde a esse problema: A área atual tem 1 200 000 m² de área construída. Desse total, 900 000 m² (75%) são mantidos, e 300 000 m² (25%) são demolidos. Até ali, 25% pode ainda ser considerado alto. Nesses 300 000 m² demolidos, serão erguidos novos 1 000 000 m². No total, depois da operação, teremos em torno de 2 000 000 m². Considerando que vamos dobrar a área, ter que demolir só 25% da área inicial, até não é nada mal.
  • Olhando por um outro lado agora: esses 1 200 000 m² representem 900 prédios. Os 300 000 demolidos representem 550 prédios. Isso é, quase os dois terços dos prédios da áreas serão demolidos. Obviamente, no projeto, se prevê demolir um máximo de prédios "pouco importantes" (galpões, imóveis pequenos, etc) e manter um máximo de prédios "importantes" (onde tem muita gente morando, por exemplo). Isso explica esse número em parte: Representa muitos prédios demolidos, mas pouca área construída. Mas mesmo assim, é assustador pensar que dois terços dos edifícios serão demolidos. É enorme. Por mais que não represente tanta área (25%), é uma cirurgia muito destruidora na paisagem urbana. É necessário isso tudo para conseguir revitalizar um bairro?
  • Outro ponto preocupante, a palavra "desapropriação" (e suas variações) é citada apenas 5 vezes nas 200 páginas do projeto, o que me parece indicar que tentaram esconder o fato.
  • O problema da gentrificação é bem complexo e difícil de evitar. O mesmo fenômeno acontece aqui do lado (Frei Caneca / Augusta), sem nenhum plano do Kassab... Assim que se mexe alguma coisa na cidade, se refaz uma pavimentação, se coloca lixeiras, etc, a especulação imobiliária reage imediatamente. Os preços aumentam, e fica cada vez mais difícil para uma parte da população pagar o aluguel. Acho quase impossível fazer algum plano urbanístico desse porte sem que isso aconteça. O que se pede a um plano urbanístico é de tomar medidas para diminuir os efeitos disso, e até acho que este projeto faz isso mais ou menos corretamente, prevê áreas que deverão manter aluguéis baixos, prevê muitos apartamentos de tamanho variodo, etc.
  • As várias críticas ao projeto encontradas na net apontam atualmente o Kassab como culpado principal. Ao meu ver isso é um engano terrível sobre quem é o inimigo aqui. O principal beneficiário dessa "reconstrução" não será ele nem a prefeitura (apesar dos substanciais lucros gerados pelas operações de desapropriação) mas as construtoras que receberão quarterões inteiros em "doação". Se trata na verdade de uma grande festa imobiliária. Terá grande distribuição de terra para todas elas. Depois da desapropriação, essas construtoras serão legalmente proprietárias das áreas desapropriadas, como consta na lei abaixo. Ali é para mim o ponto mais grave, um instrumento muito excepcional e perigoso como a desapropriação, que quando acontece deve acontecer somente por razão superior de interesse público, e o resultado da desapropriação se tornar propriedade pública (parque, centro cultural, escola, etc), aqui serve para "doar" prédios para empresas.
  • Um lei municipal (texto integral aqui foi promulgada para permitir a execução do plano todo. Essa lei não diz que as construtoras terão poder de expropriar (razão provável pela qual não deu certo a recente tentativa de impedir a lei, baseada nessa tese), mas mesmo assim contem trechos bem assustadores como a transferência de propriedade automática do expropriado para a construtora.
  • Por info, esse plano começou em 2004 (prefeitura de Marta Suplicy) e foi continuado por todos os prefeitos que seguiram, não houve ninguém para se opor ao projeto...

Aqui terminam mais ou menos as conclusões que tiro do projeto em se. Para resumir, acho que considerando tudo, é um bom projeto, equilibrado, que tenta propor, apesar do grande aumento da população de moradores, uma solução rica, complexa, e é cheio de ideias interessantes, e que respeita bastante bem a diversidade de população e usos atuais.

O grande problema, fora a demolição (com a consequente desapropriação) maciça que ele provoca, é a "arquitetura" legal atrás dele que permite a transferência automática de propriedade de dois terços dos imóveis para as construtoras que tomarão conta do lugar. O tamanho da demolição, 25% da área construída, não seria em se exagerada se fosse feita pelos próprios proprietários, e não imposta por cima. Imagino que é mais ou menos o que aconteceria "naturalmente", se o bairro ganhava meios e incentivos para fazê-lo ele mesmo. Eles também iam começar por vender os galpões velhos, depois os prédios pequenos, etc.. e chegaria provavelmente a um número similar. Leia também este artigo que tem uma opinião um pouco diferente da minha sobre essas operações urbanas...

Francamente não sei se atacas globais ao projeto terão muito efeito... Espero que se mobilizem gente suficiente para travar o processo "imobiliário" canibal. Acredito que o projeto ficaria válido mesmo diminuindo drasticamente a invasão das construtoras, talvez consigamos convencer alguém la "em cima"? Acho uma pena de jogar fora o bebê junto com a água do banho...

Disclaimer: Esse texto todo é apenas a minha humilde opinião, viu? Não é importante, ninguém vai seguir ela, não vale a pena começar uma guerra de ideias, ok? Isso dito se você tiver críticas interessantes ou ideias para acrescentar, por favor não deixe de coloca-las abaixo!


permalink:  6   posted on 09.01.2012 7:57
From The Wanderer
Hi
I was looking at your Blender Greenhouse project and wanted to download a couple to check them out.
But unfortunately the texture links are broken
any chance you can fix that ?

Thanks

permalink:  5   posted on 08.01.2012 17:41
From shynewbie
Commenting post 184: hi there mighty yorik

in .12 version, display mode property always excludes "shaded" option.
it seems to be not working anymore,
chatting with danielfalck at irc #freecad,, he experiences the same thing...

permalink:  4   posted on 08.01.2012 17:35
From Aron
Hey, I like your work.

in categories  3d  works  permalink:  3   posted on 07.01.2012 17:31
From Yorik

House renderings



A couple of images for a house projected by our friend Daniela Walty...












in categories  freecad  opensource  permalink:  1   posted on 02.01.2012 22:44
From Yorik

Scale feature in FreeCAD Draft


I changed a bit the current scale tool in the Draft module. It now uses a parametric object instead of modifying the base object. The parametric object allows you to change the scale factor afterwards. The old behaviour is still available to python scripting, though.