YORIK’S COFFEE CORNER

Hi, this is my blog, and also a guestbook. I publish stuff I do from time to time. Be welcome and feel at home, have a coffee and don't hesitate to drop me a line or two. All languages are highly welcome, especially the most exotic ones (nederlands, bij voorbeeld...).

You are currently viewing only posts tagged as cad in this guestblog.

Click here to go back the blog home page, or browse by tag: linux, opensource, blender, freecad, 3d, works, animations, architecture, projects, detail, sketches, photo, bede, webdesign, wordpress, idsampa, inthepress, cooking, trilhas, orange, Architecture, or search the 2012, 2011, 2010, 2009, 2008, 2007 or 2006 archives.


in categories  freecad  opensource  permalink:  206   posted on 07.02.2013 18:47
From Yorik

FreeCAD plans


The 0.13 release of FreeCAD is being prepared and is almost ready (we are now uploading sources everywhere and building packages), so this is a good time to plan a little bit what I will be working on next...

General
  • Switch our wiki, mantis and phpbb to self-hosted
  • Try to achieve python3 compatibility, so we can have blender-in-freecad or freecad-in-blender again (basically import freecad files in blender and vice-versa)
  • Try to make standard icons use the current qt theme

Draft module
  • Separate upgrade and downgrade tools into smaller parts, to make them more extensible / configurable, and easier to fix bugs
  • Make upgrade and downgrade available in scripts (put them in Draft.py)
  • Turn the Draft snap icons into FreeCAD commands
  • Redo the dimension tools, simplify them (solve the orientation hell), use a placement, see if it is possible to base their coin node on Lukes sketcher dim node

Arch module
  • Better IFC import, get rid of internal parser if possible (keep it as a separate option), try to support IFC objects subcomponents (base polyline, separate shape representations, openings) if available
  • Better struct tool, allow placement, to choose base profile, etc
  • Add IFC export (add python bindings to IfcOpenShells exporter)
  • Add materials
  • Explore the concept of space, an empty volume limited by walls, floors, ceilings or anything else. Ideally have a two-way link between the space and its bordering elements (a space is defined by its borders, but changing the dimensions of a space could or should move its borders... seems difficult to achieve)
  • Explore the concept of floors, basically be able to calculate floor areas of a project. Maybe relate to spaces, but spaces might not always have a floor area...
  • Explore the concept of multilayer objects, typically walls. Many complications arise, such as capping, corners and openings...

More about what I plan for walls here

Spreadsheet module
  • Basic spreadsheet object
  • Basic spreadsheet viewer
  • Basic spreadsheet view (group of cells)

Drawing module
  • Allow the webkit viewer to draw a page background when viewing an svg file
  • Try to use the webkit viewer instead of the qsvg viewer. AFAICS main thing needed is signal-slot to update the contents.


If you want to keep updated with what I do there, check my assigned issues on the issue tracker

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...

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:


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  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  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!




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!


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!


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...

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.

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


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:


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  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  freecad  permalink:  26   posted on 28.02.2012 13:55
From Yorik

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...

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...


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.

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.


in categories  freecad  opensource  permalink:  182   posted on 30.12.2011 2:29
From Yorik

Editable titleblocks in FreeCAD



Lots of new features are arriving after the 0.12 release. I just implemented editable titleblocks:



More here.

in categories  linux  freecad  blender  architecture  opensource  permalink:  97   posted on 22.09.2011 16:52
From Yorik

Linux for architects


This is a little introduction to Linux for you architects who have never tried it, but would like to know what's all the fuss about it and if it is really usable for working with architecture. If you know Linux already, I'm sure you'll find a lot of missing info in this text and find it maybe a bit too enthusiastic, but we are whowe are, aren't we...

This article is a sequel of another short article I wrote back in 2009 to present some tools available to architects on the Linux platform.

Just a small note, What it is exactly?

Actually it's wrong to call Linux Linux. Linux systems are not all-in-one, monolithic things like Windows, but rather a complex assemblage of software pieces, Linux being only the base block.

Linux is based on Unix, its predecessor, and follows a basic Unix philosophy: Rather than having one huge all-in-one application that does 1001 tricks, have 1001 small applications that do each one one simple task, but do it well.

Most of the other pieces come from a project called GNU, that's why those systems are usually called GNU/Linux and not just Linux. But let's make it simple and continue to call it Linux.

Of course make those thousands of small applications all work seamlessly is not a small work, but fortunately it has been done a lot of times already. This is where comes what we call a Linux distribution, which is a complete operating system, based on GNU/Linux, made of hundreds of little pieces, all working in a big symphony. Ubuntu is one of the most famous Linux distributions.

First things first, Why Linux Is For You

  • Linux is free. This means not only that you don't pay anything, but also that you are free to do what you want with it: download it, distribute it, share it on bitTorrent, (you caneven sell it), without having to do anything or report to anyone. Like GNU people use to say, it's free like freedom, not free like free beer
  • Much more important than being free, it will stay free forever. Like most free software, its code carries a license that prevents it from being bought by a firm and stop being free.
  • Your distribution doesn't only provide you with the Linuxoperating system, but with almost any piece of software that runs on Linux. As a consequence, all your applications can be installed easily from your distribution's servers, and your whole computer, not only the operating system but ALL yourinstalled applications, are updated automatically.
  • Linux inherits another very important thing from Unix: The rock-solid built-in protection of networking, files, processes and users. As a consequence, Linux is almost invulnerable to viruses (there is no Linux virus known today) and easily protected against network intrusions.
  • Linux and most free applications that runs on it are programmed and maintained by people who have no commercial reasons to do it. They do what they think is best, not what they think will sell better. Your software will never force you to buy a new computer (Linux and most free software run fine on very old hardware) or a new plugin, and software evolves extremely fast (new features land on your system almost every single day).
  • People who make free software are extremely social. You find them easily, talk to them, discuss, share ideas, and easily get involved in directions your favorite application is taking. All happens through forums, email discussions, chat rooms or facebook pages. If you miss some feature and you can convince people of the importance of your claim, chances are high that someone will implement it.
  • Linux can safely be installed side-to-side with another operating system such as Windows. A menu will then appear, at boot time, to allow you to choose which system to boot to.

The Bad

Of course nothing comes without disvantages. Here are a few issues you might expect:
  • Bleeding-edge new hardware might not be totally supported yet. Nobody has commercial urge to make Linux work for your particular hardware, so you usually have to wait until some Linux programmer will get one for him, be annoyed be the fact it isn't supported, and remedy the situation. It's always a good idea to test before installing or investigate before buying.
  • Windows software doesn't run on Linux systems. You will need to get used to other applications. But most of the usual ones have one or many excellent or even much better alternatives in Linux, and nowadays more and more applications such as Google Chrome, Firefox or Open Office can run on both Windows and Linux. Some more specialized commercial-grade applications such as engineering applications still don't have a Linux alternative, though. You will sometimes need to do some homework and find workarounds to palliate to that situation.
  • There is no firm behind Linux. Nobody to call, nobody to complain to. Although some firms may offer you tech support, you are on your own in most cases. But fortunately most answers are very easy to find on the internet, a simple search like "How to resize a picture in Ubuntu" will usually give you an easy and immediate answer.

So what does it look like?

If you managed to read until now, you must be a bit curious to see what it looks like, right? I gathered here a couple of screenshots from the most common distributions:

Below is the latest version of Ubuntu, probably the most famous of all Linux distributions, and one of the most friendly to new users. In this version, Ubuntu introduced a new way to navigate through your files and applications, called Unity, which is the vertical bar containing icons on the left:



Another very good distribution is LinuxMint. Linux Mint is based on Ubuntu, so it inherits all the qualities of its father. But its developers put a special effort into style and design, so Linux Mint is often the favorite distribution used by artists:




This is another of the most famous ones among new users, called Fedora. Fedora is derived from a famous commercial Linux system called Red Hat, and it inherits from it a great deal of novelty and power. Fedora is usually liked because it brings bleeding-edge features faster than the others:



But most Linux systems are deeply customizable, and you can usually make your desktop look like your wildest dreams. Here is, for example, a screenshot of my own desktop:



How to get it

Most Linux distributions have a great feature: The installation CD is also a Live CD, that allows you to run your Linux system entirely from the CD, without installing anything. This is a great way to test, to see if it runs well, and if you like it at all, without risking to do any harm to your current system. The proceeding is very simple:
  • Download an .iso CD image from one of the distribution sites indicated above. Sometimes they have several flavours, such as 32bits or 64bits. Choose one that suits your computer. Since a full CD image is a big file (700Mb), Most of them allow you to download it via bitTorrent if you prefer. Some even provide DVD versions, which include more pre-installed applications.
  • Burn that image on a blank CD. Be careful, burning an image is not the same thing as copying a file on a CD. Simply copying the .iso file on the CD won't work, you must either right-click on the .iso file and select a "burn this image to disc" option, or open your disk burning software and find the "burn disc image" option. When your disk is burned, it will contain several files, not the .iso file.
  • Now place your fresh CD in your CD drive, and reboot your computer. On some systems, you must allow your computer to boot the CD before booting the Hard drive, this is usually done by pressing a key (F2, F12) during the first seconds after powering up and selecting your CD drive in a list.
  • Your new operating system will now boot. Remember that nothing is copied to your computer, so you can play safely with everything, there is no risk to harm anything. Just remove the CD and reboot, and you'll be back to your original operating system. But remember too that nothing you do while you are running from the CD will be saved, so you will loose any work you do during that time.
  • Most Linux distributions, when running from the CD, will have an "Install to Hard Drive", icon, which you can use when you are ready to install. You will then be taken to a step-by-step install procedure.
Now where are the file explorer, the internet explorer, the windows messenger, the acrobat reader, photoshop, skype, notepad, word, excel? Well, almost none of those are there, but all have at least one equivalent. Explore the menus and you will find everything in no time. And if something is missing, it can easily be installed by the system itself.

This is, for example, the Ubuntu software center, from where you install just about anything:

Okay, after all this bla-bla, what about doing architecture work?

The problem you'll encounter with Linux is that none of your usual architecture software will work. No Autocad, no Revit, no Archicad, no Vectorworks, no 3DS Max, no V-Ray. Those are all windows-only (some run on Mac too), and it's very unlikely that their developers will want to spend time in doing a Linux version in the near future.

So, how bad exactly is the situation?

Actually it is not bad at all, but you will need to learn to use new software, there is no way to avoid that part. Apart from that, it is actually possible to work without any problem.
2D CAD
In the 2D CAD field, we have a couple of options now. Some are totally free, like QCad,Cademia or the new and promising LibreCAD. Those, since they are maintained and developed by a community, might lack some commercial features like DWG format compatibility. This is LibreCAD:



We also have several commercial applications, which are not free, but run natively on Linux, and have all the features that you would expect from a commercial application, such as DWG compatibility and technical support, like Ares Commander and BricsCAD. Here is BricsCAD:



And, since a couple of months, we now have a free AND commercial application called DraftSight. DraftSight, although owned by a company, is distributed for free, and supports DWG format natively:

3D CAD & BIM
Here unfortunately things are less easy. There is at the moment no ready solution, but there are several efforts going in that direction, so the future is promising. One of these efforts is an application called FreeCAD to which I have the honor to contribute with coding in my spare time. FreeCAD is a full modern parametric modeler, and although very young, it already has a lot of interesting functionality for doing architecture, such as a 2D drawing module, usual 3D tools such as extrusion and booleans, and a 3D-to-2D module. A real BIM module is also in development.



I write a lot about FreeCAD on this blog...
3D MODELING & RENDERING
In the area of 3D rendering, things are not only better but state-of-the-art, thanks to an amazing piece of software called Blender. Blender runs on windows too, so chances are high that you heard about it already. Blender is for me the best general-use 3D application available today. Better than 3DS Max, better than Maya. It is faster, smaller, and made by 3D users instead of made by Autodesk. Blender can do everything that those 2 applications can do, and has several external renderers available.

The only drawback of blender is that it can be hard to learn if you are much used to another 3D application. But I warned you about that already...



In fact, I use Blender so much that it is now not only what I use to do rendering, but also to compose architecture:



I also write a lot about Blender, there are also many tutorials on the homepage of this site.

But there is something I didn't tell you yet. Remember I told Windows applications don't run on Linux, right? Well it's not totally true. There is a little gem of a software, called Wine, which allows to run Windows applications on a Linux system. It won't work with all applications, and many will run with problems. But one of the applications that runs almost perfectly is Sketchup! Installing Windows applications with Wine is nowadays almost as easy as installing them on Windows, and they integrate seamlessly on your desktop (But of course it is never as comfortable and fast as running a native Linux application). The Wine website has a list of windows software that runs with it, with ratings, comments and notes.
2D PAINTING & PHOTO-COMPOSITION
What would be of us architects without photoshop, right? The most famous Linux photoshop-like application is called Gimp, and, although many purists will argue that it lacks some or another indispensable photoshop option, is an excellent and very mature application, totally able to perform all the tasks architects usually require from photoshop, and, thanks to the typical friendliness to extension and customization found in most Linux applications, you can extend it into a very powerful digital painting platform.



To give you an idea, this is the kind of drawing that you can achieve with gimp only:



But a lot of digital artists use Linux nowadays, so there are many more interesting tools available, like MyPaint or Krita. Another must-have Linux application is inkscape, which is a vectorial drawing application, similar to Corel Draw or Illustrator. It is commonly used for drawing diagrams, icons and vector artwork, but is perfect for mounting more complex presentation sheets.



Also worth noting, many of those applications also run on windows, so it's a good place to try.

Are there architects out there who use Linux?

Because of all the little problems but mostly because it is not very well known, very few architects use Linux at this time. But things are changing fast... Here is a list of interesting people who share tips, techniques and resources about the subject: Enjoy!

in categories  freecad  opensource  permalink:  77   posted on 22.09.2011 16:50
From Yorik

Draft objects are now usable with PartDesign module





Now Draft objects can be drawn on any existing face. If the working plane was not set manually, the face on which you begin to draw will automatically determinate the working plane. If you draw closed shapes, they can be used for Pads and Pockets too.

in categories  freecad  opensource  permalink:  147   posted on 22.08.2011 16:48
From Yorik

FreeCAD Arch module: working on top of sketches



I just made a couple of improvements so walls can be automatically built on top of complex sketches. This way, it is now possible to build your whole floor plan from one sketch, having it completely constrained...

After you build a sketch, just press the Wall button and that's it!




in categories  freecad  opensource  permalink:  132   posted on 28.07.2011 3:18
From Yorik

The FreeCAD Arch module, development news



I recently made a bit of progress on the Arch module front. Things are still far from efficiently usable, but there are already a couple of easy operations that can be done, and several of the tools have been refined. We now have two basic architecture components (Wall and Structure) and containers (Cell, Floor, Building an Site), plus two tools to simply add or remove components to/from a container. This is temporary, that operation is planned to be done by dragging and dropping directly in the tree view later.

The wall and structure tools are most useful when used with a selected object such as a line or open wire, for a wall, or a closed shape, for a structure. But they can also be invoked without any selected object, in that case the wall is built on a default line that can be edited and extended, and the structure is a simple cubic element. They can also be based not only on a wire, but also on a face or a solid. Of course a face only allows to specify an extrusion heigth (no width and length) and a solid doesn't allow you to teak anything. But in the future when walls will grow more complex and orient how they look in 2D be able to make any solid shape behave like a wall will be very useful.

I also built a temporary system to export 2D data from blender to FreeCAD, while there is no dxf exporter available for blender 2.5x. There is also a new "group layers into compounds" option to the Draft dxf preferences, which, instead of importing every single dxf entity, groups objects from same layers into compounds, which turns the import and 3D view operation blind fast.

Another area where I put some effort recently is in the blender to freecad workflow. There is nothing better in the world to conceive architecture than blender. Think of the flow and easiness of sketchup but with the power of 3ds max. But blender works in meshes, which is at the same time annoying and the key for its success. Meshes are very simple (too simple), but because of that, very flexible and fast.

FreeCAD imports blender meshes very easily. Until now I haven't seen that operation fail once. Just export them as .obj from blender, and import that .obj file in FreeCAD, thats it. Remember that the obj format has the annoying particularity to invert Y and Z axes.

Maíra and me are currently working on a project that is totally developed on blender. This is the project in blender, so you can evaluate the complexity:



And the same project, exported and imported in FreeCAD:



Everything is there, precisely. The file in that state is available here, in case you want to have a look. In spite of the complexity, the 3D display of FreeCAD is totally able to handle that amount of data fluidly. The big hiccup is when you are getting a lot of separate objects in the document, but I'll come to that later.

I also drew a base plan in draftsight (on top of an exported 2D view, with the tools I mentioned earlier. That plan was saved in dxf and imported back in FreeCAD:



I then positioned and rotated that plan to fit perfectly under the mesh model. Since both were extracted from the same model originally, the coincidence is perfect. I did it that way and not the other way round so next time I import the meshes from blender they will fit right into place.



Then come the interesting bits. I first added a tool that splits a mesh into separated components. When you model in blender, it is often more convenient to group several objects into one. For example, here, each building block is one blender object. This allows you, in blender, to keep everything under one local coordinates system. But you must also take care of keeping different part dissociate (use the Y key a lot), this makes it easier, for example to select all pillars inside the buiding. And finally, you must also take care of creatign as little non-manifold pieces as possible. Non-manifolds cannot become solids, which is very important later. Use a lot Ctrl+Shift+Alt+M in Blender to highlight non-manifold edges.

The split tool in FreeCAD also highlights non-manifold components, painting them in red:



Then it's easy to temporarily turn off the non manifold components, and concentrate only on the important parts:



Then there is another tool to convert selected meshes into solids:



This tool is based on a macro that has been on the wiki since a while, based on Werner's mesh-to-part conversion work. The big thing is that it joins coplanar faces, simplifying tremendously the geometry. But I found out it still behaves bad with very complex meshes, made of a lot of small faces. In case the tool cannot build solids, the bad results are also highlighted, and the mesh is not deleted:



But anyway it doesn't make too much sense to have beams and slabs as one big element, so I'll either remodel that part in Blender or directly in FreeCAD. Once we have or solid Part shapes, converting them into walls or structural elements is a simple press of a button (I pained them in yellow here so it's easier to see):



That's about where we are now. Not much you'll say, but turning "raw" mesh data into parametric objects is a very important piece of the game. Next development steps will include complexifying those objects and giving them additional properties, then I'll start experimenting with automatic sectionning, which will probably be the most spectacular achievement. At the end of the jouney, I plan to obtain that kind of output:







The first one is the dxf plan that I imported in FreeCAD above, the 2 others are sections taken from sketchup. They look quite nice, but they are extremely unusable because of the too high complexity. There are so many lines that it is almost impossible to rework, in any application. But sketchup makes sections for rendering, not for reworking, and I have good hopes to achieve much better results inside FreeCAD, since our objects are not meshes anymore but much optimized solids, and getting precise contours, and distinguish what is cut from what is viewed is very easy.

A final note about complexity, the biggest problem at the moment in FreeCAD is that when dealing with high number objects in your document, things get pretty slow. A 2D plan like the one above, when imported line by line, is almost unworkable. But the complete mesh project from the first image shows that the 3D view is perfectly able to handle a very high amount of data, the tremendous difference shown by my little upgrade to the dxf importer and Jürgen's recent work on the View Providers show that the problem is totally solvable. The key, at Arch module level, seems to be in quickly grouping smaller objects into higher-level containers. I'll also have a look at the FreeCAD zoom system, but there are certainly many things to do to solve that issue.

That's it for now, thanks for reading until here!

in categories  blender  freecad  opensource  permalink:  116   posted on 11.07.2011 20:40
From Yorik

Exporting 2d linework from blender 2.5



Blender 2.5X still does not feature the excellent dxf exporter Migius wrote for blender 2.49, so I mounted this little workaround to be able to export linework from a blender model to a 2D CAD application such as FreeCAD or LibreCAD (or AutoCAD if you really must...).

It is made of two scripts, a blender addon to export and a FreeCAD macro to import. In blender, install the addon the usual way, then use it from the export menu to export the selected meshes. What will be exported is simply all the edges of the selected meshes in a text file, one edge (2 vertices) per line.

Then, place the FreeCAD macro in your macros folder, then run it, select the exported .txt file, and voila, your objects edges get imported, one compound object is created per blender object. You can then select everything and export to dxf if you want.

Here are the two scripts:
http://yorik.uncreated.net/scripts/blender25/io_export_flat_edges.py
http://yorik.uncreated.net/scripts/importFlatEdges.FCMacro


The meshes to be exported in blender


The imported linework in FreeCAD


The same linework exported in .dxf fomat and opened in LibreCAD.

in categories  freecad  opensource  permalink:  75   posted on 19.04.2011 22:58
From Yorik

Collada support in FreeCAD


I just found this interesting piece of software called pycollada and used it to make FreeCAD able to import collada files. The support is very basic, only simple geometry is imported. No materials, no components or whatsoever. But it is already pretty handy for a serie of uses. The image below shows an imported collada file generated by the BIMserver (as a little appetizer, waiting for true IFC support)...


in categories  freecad  permalink:  71   posted on 14.04.2011 20:24
From Yorik

FreeCAD t-shirts


I made this design for a FreeCAD t-shirt. If you want yours too, follow the instructions! (No money goes to the FreeCAD project, so do it only for the fun, not to help the project!)


in categories  freecad  opensource  permalink:  64   posted on 05.04.2011 24:15
From Yorik

More FreeCAD dxf export options...


I did some more work on the dxf exporter, now it begins to behave pretty accurately. You can now set an option in the preferences screen, in order to export 3D objects to polyface meshes. This is not the ideal way to export FreeCAD 3D objects, because they will be turned into meshes, so you'll loose important data such as curved surfaces and solid behaviour, but it is the only way to put 3D into a dxf file available to us as long as the ACIS format is kept closed and undocumented.

The other fix I did is to make the way to export 2D Drawing pages to dxf format work better. We now have fairly precise results when exporting such pages. The only thing you need to do is to select a page object, hit File->Export and specify a .dxf filename. There are still some glitches, some objects don't get drawn at the correct scale, etc... But the result is usable already. Below is an example of what you can expect to obtain:



The objects in the FreeCAD viewport



The same objects placed on a Drawing sheet



The sheet exported as dxf and opened in LibreCAD

in categories  freecad  opensource  permalink:  42   posted on 24.02.2011 24:26
From Yorik

Towards an Architecture module in FreeCAD


I began to start on an architecture module for FreeCAD. I saw a lot of extatic tweets about the subject these last days, so I thought everybody would like a little explanation, even if things are still very bare. So far I have an IFC parser (adapted from the work of Marijn van Aerle working, that is now able to parse all my test files without errors. Then there is a second part of the importer which is responsible for creating the corresponding objects in FreeCAD. So far that part is only able to grow simple walls, mainly because that's the only "architectural" object already implemented.

We have had a couple of interesting discussions about how to implement other concepts, and things are beginning to come. We now have a pretty functional wall, that can be based on a line or a wire (a polyline, in OCC jargon), a face or even a solid. It can receive appendices (that get joined to it) and holes (that get subtracted to it), although there is still no UI controls for all that.

There is also a floor object, which at the moment is only a container for walls (or other floors), with the particularity that it can join walls that intersect. In the future of course it'll have other attributions such as cutting plan views, etc).



There were also some talks and discussions about the BIM concepts, etc... But being more a practical person, I prefer experimenting and playing with FreeCAD objects gradually than laying out a big plan conceptual ahead.

For now that's it! More to come...

in categories  freecad  opensource  permalink:  82   posted on 22.02.2011 16:49
From Yorik

Sections coming soon...



in categories  freecad  opensource  permalink:  250   posted on 29.11.2010 22:58
From Yorik

Outputting 2D dxf through FreeCAD itself

Last couple of days Dan Falck and I were chatting about how convenient it would be to be able to output flat, 2D dxf files from any 3D-to-2D process like FreeCAD's drawing module. I've been since then experimenting with that, mainly using Inkscape as a convertor, since FreeCAD outputs 2D drawings in svg format. Inkscape is capable of outputting dxf files, but the quality is not very good.

The other day a much better idea stroke me: The Draft module of FreeCAD is itself capable of reading svg and writing dxf! So I did some new experiments (and a lot of bugfixing) and the result is definitely not that bad.

This is the base file I used for testing:



I then produced a 2D Drawing from the objects in the scene:



This is the scene objects, without passing through the Drawing module, simply exported as svg directly from the 3D scene, then reimported into freecad:



This is the 2D Drawing module output, reimported into FreeCAD:



And this is the same one, exported as dxf (and opened in Caduntu):



Of course the result is stil far from perfect (although much better than last time). The main problem is with the dimensions, which get converted to dummy wires (and have some artifacts too, some bug I must solve). SVG format doesn't support dimension objects. So the thing is, how to do that? Create a new svg tag? I'll have a look around, if other people already thought about that problem...

in categories  freecad  permalink:  198   posted on 20.11.2010 19:40
From Yorik

Another example of FreeCAD 2D drawing


I was showcasing FreeCAD to a friend the other day and we came to mount this nice little drawing. Don't look too close at the project itself since it is more the result of divagations and tests than proper architectural research, but it is a good showcase of what is currently possible:

The FreeCAD 3D view (file available here):


And the resulting svg drawing (file available here):

in categories  freecad  opensource  permalink:  184   posted on 16.11.2010 12:21
From Yorik

Using background images for tracing in FreeCAD


I just implemented this little feature:

Rectangle objects now have a "Texture image" property, where you can choose an image file. That image then gets mapped on the rectangle. You must of course take care of making the rectangle the same proportion as the image. But this way, specially combined with the transparency property, you get a great way of tracing CAD objects over a scanned paper drawing.

in categories  freecad  opensource  permalink:  174   posted on 14.11.2010 16:12
From Yorik

FreeCAD 2D dxf export


FreeCAD can now export a 2D drawing page to dxf. It is preliminar and still buggy but it works:

This is the normal svg output


This is the dxf output. FreeCAD uses inkscape to generate it, so inkscape must be installed on your system. All you need to do is select a Page object and hit the File->Export menu item.

in categories  opensource  freecad  permalink:  125   posted on 16.08.2010 22:46
From Yorik

FreeCAD and SVG output

Putting your drawing on a SVG sheet in FreeCAD is beginning to work well. Here is a recent example:

In FreeCAD:


And the outputted SVG:


It is almost perfect, I still have a small problem regarding texts location (there is a shift between both), and the svg hatches which are not too good and for which I still didn't find a solution.

Download the .fcstd file here and the .svg file here.

in categories  opensource  freecad  blender  permalink:  122   posted on 11.08.2010 14:45
From Yorik

More on FreeCAD, or Generative Components-like workflow on Linux

I did this interesting little chain yesterday, you might find it interesting. With a bit of trickery, you can really do some interesting parametric-generated architecture design on linux, only with open-source tools. And when I say architecture design, I mean the whole production chain, from conception to paper prints.

If you don't know Generative Components, it's a piece of software made to design architecture compositions based on sets of parameters that you can make evolve to create "beautiful" parametric-looking structures... I recently discovered an amazing application called StructureSynth which does exactly that: create geometry based on parameters and rules.

You design simple rules in a very simple language, such as: "Rule n°1: move 2 units in x, rotate 15° in y, then create a box, then reapply Rule n°1". Then, all the magic is here: You can specify another, different Rule n°1. The program will interpolate both randomly, and create randomic variations:



The version of StructureSynth in the Debian repositories comes with a set of exporters for different renderers such as Sunflow, and Blender, (with the help of a blender import script) which I used here to import the geometry:



The blender import script imported all the geometry as one single object, so I first separated it in original parts (Edit mode, select all, P -> separate all loose parts), then exported it as an .obj file, that < href=http://free-cad.sf.net>FreeCAD can read. Of course the blender import script could easily be adapted to FreeCAD so we could skip the Blender step, but I found it interesting to show how the geometry passes from one to another without any data loss.



FreeCAD can work with several types of geometry. Our .obj file was imported as Meshes, but much more interesting is to work with bRep objects, which are FreeCAD's "native" object type, and permit much more complex functionality (they have the notion of "solid", so boolean ops work perfectly, they can have real curved surfaces, etc). So I converted my meshes to brep parts with a macro, and added a couple of lines just to show you how 3D and 2D begin to mix well in FreeCAD.

The Draft module in FreeCAD can already give you nice results when putting your scene geometry on a sheet. Of course the Draft module is made for 2D, so you'll notice the 3D parts are not displaying very correctly (face inversions, mostly), but that problem will be addressed soon.



To show you better the possibilities of the Geometry-to-paper process, I did another example. It suffers the same problems as the one above, but the control over display (colors, line width, texts, etc...) begins to be good.



This is a quick structure I did just to play with the process, and here is the SVG output:



SVG files already carry informations such as paper size, and it is as reliable as pdf (you can easily turn them as pdf with apps that support svg such as Inkscape or directly from FreeCAD). At the moment the informations in the template (Project author, etc...) cannot be edited directly from within FreeCAD, so you need to edit your sheet in another app, but that also will probably be addressed one of these days.

in categories  opensource  freecad  permalink:  120   posted on 09.08.2010 23:06
From Yorik

What's new on the FreeCAD front



There are several cool new things coming to FreeCAD so I decided to show you a bit of what's going on. Most of this stuff will be in the 0.11 release (no release date prevision, it's done when it's done). There is a 0.11 preview installer for windows on the FreeCAD website, otherwise you'll have to wait a bit (or compile FreeCAD yourself if you are brave enough). I'll focus more on the 2D part, since it's what I'm mostly doing there...

The most interesting thing that has been added recently by Werner is python-driven Part objects. Unlike the older python Document objects, where you had to do everything, compute the geometry, and define how that geometry gets displayed in the 3D scene, the new Part python objects automatically display their geometry the "standard FreeCAD way". That allows for extremely simple python objects such as this:
class Line:
    def __init__(self, obj):
        ''' App two point properties '''
        obj.addProperty("App::PropertyVector","p1","myCategory","Start point")
        obj.addProperty("App::PropertyVector","p2","myCategory","End point").p2=FreeCAD.Vector(1,0,0)
        obj.Proxy = self
 
    def execute(self, obj):
        ''' Print a short message when doing a recomputation, this method is mandatory '''
        obj.Shape = Part.makeLine(obj.p1,obj.p2)
 
ml=FreeCAD.ActiveDocument.addObject("Part::FeaturePython","myLine")
Line(ml)
As a result, the 2D drafting module has been completely upgraded to take advantage of this. One of the most useful consequences is that it now has an editmode. But it also allows for several other goodies, such as enter FreeCAD's parametric chain (for example, an object made of the union of two other objects retains the original objects, etc):



Because of this, the use of the Drawing module is now much easier, and you can already output much better sheets:





Another area that is being currently worked on by Jürgen is the Sketcher, which allows you to draw constrained 2D shapes. There is still not much new stuff visible, but it has been almost rewritten from scratch, and is now much more stable and works on all platforms. Now really the sketcher can be used to build geometry.



Of course all this is pretty new and lots of bugs are expected to appear, but we come everyday closer to the day we can start to do serious productive work with FreeCAD. As a sidenote, one of the things we lack badly is bug reporting. If you happen to find a bug, if you make FreeCAD crash and can reproduce the cause of the crash, don't hesitate and add a report to the bug tracker. This is a very important for FreeCAD to reach some stability...

in categories  opensource  freecad  permalink:  64   posted on 29.04.2010 22:18
From Yorik

Playing with FreeCAD...

I just made this little "thing" while searching for a cool new splash screen. I got very impressed by Form:uLA yesterday (specially this work)... Kind of 3D Lebbeus Woods...







The FreeCAD file is here...

in categories  opensource  architecture  freecad  blender  linux  permalink:  40   posted on 28.11.2009 2:25
From Yorik
Actually I really should write a kind of FAQ or article about doing architecture on a Linux platform... Many people are indeed interested by the subject. So, here we go:

My architecture workflow on linux

Actually there is no obvious or productive workflow possible at the moment, due to the lack of good (productive) CAD software on linux. You can do architecture on linux, but you won't have the same level of productivity as if you just draw with your favorite CAD program under windows (I indeed have a dual boot system .


just for the fun, my linux desktop!

That said, if you are willing to move away from the "all-in-one" solutions that big CAD vendors sell, you already can do a very big part of the work with linux software. I myself use blender for about 80% of the conception work, the rest being simple hand sketching. You already have several good scripts to generate plans and sections from your models in blender, and export them to convenient CAD formats like DXF. Search the blender wiki scripts section.

In blender you can do all kinds of useful things like importing your hand-drawn sketches, pieces of 2D CAD plans, model on top of it, etc, for example:


blend file here

The biggest problem is then, when you want to do 2D CAD. There are indeed several solutions, like qcad, autocad under wine, bricascad/intellicad, or long-time linux CAD challengers, like cycas, graphite one or varicad. There are also a number of interesting newcomers, like realCADD or medusa. But none of those solutions are really productive and free at the same time.

What I do most of the time, when I don't need much detailing, is to use several programs, each for doing pieces of the work. This is a typical unix-like approach (use several simple, reusable programs to do separate tasks, instead of having one all-in-one program) that in my opinion could benefit much architecture workflows on linux.



I myself contribute with coding and documentation to a very interesting program (currently) named FreeCAD that could hopefully fit very well in the middle of the workflow, to rework data coming from 3D into precise construction drawings. It is in usable state already, but not for real production.



Note that FreeCAD is not at all aimed at becoming another autocad clone, and 2D drafting is only a temporary use I make of it. The plans for the future of FreeCAD include much more powerful things such as parametric modeling, automatic sectionning, or structural analysis.
Today I still use a mix of other programs, such as autocad, qcad or sketchup. I also use different utilities and convertors to manipulate different file formats, like RealCadd converter or Varicad viewer.

The same way as the data you export from a 3D program to a 2D app, the way the data is formatted is the most important point, not the program you used to make it. If you modeled your building correctly, you will have good 2D data, easy to rework in 2D. The same should apply to 2D data. If you build your technical drawings correctly, they will be easy to export to other programs for presentation work.

The presentation work in itself is also easy to do under linux, there are several programs able to import technical drawings and rework them, my favorite being inkscape:



I also use gimp a lot.

All this works quite well for short or limited architecture projects, like competitions or draft projects, but of course, not so well for more detailed work such as execution drawings. For that, we would need better tools for technical drawing. At the moment I don't know any that is strong enough to allow fast, efficient and beautiful work. But the way we draw architecture is slowly changing too, so maybe new solutions will begin to appear on the linux platform too.

And if you are interested in helping the situation to evolve quicker, there are many great open-source projects out there that could use your efforts, even if you are not a programmer. This is the case of most of the software I showed in this article.
Note: I wrote a sequel to this article, explaining how to get started with Linux...

in categories  opensource  freecad  permalink:  90   posted on 28.11.2009 1:55
From Yorik
New FreeCAD package for 64bit debian/ubuntu
I just packaged the latest version... Still not a fully debian-compliant package, but should install without problems!
http://yorik.orgfree.com/archive/packages/freecad_0.7-2087_amd64.deb
Note that the pivy package is now separated and needed too:
http://yorik.orgfree.com/archive/packages/python-pivy_0.5.0-1_amd64.deb
Enjoy! Edit: Ubuntu users seem to have a problem installing the python-pivy package, so I made an alternative version here.

in categories  opensource  freecad  blender  permalink:  105   posted on 28.11.2009 1:55
From Yorik

FreeCAD import script for Blender

I just made a new script to import FreeCAD files into Blender. You must have FreeCAD installed for this script to work, and you must configure the path to your freecad.la file at the beginning of the script.
The script can be downladed here: import_freecad.py


Note: at the moment you need a recent SVN version of blender (>2111) to make it work...

in categories  opensource  freecad  permalink:  135   posted on 28.11.2009 1:53
From Yorik

New dimension tool in FreeCAD

A very basic first draft of a dim tool is now available in FreeCAD (in the Draft module). Don't expect much of it, it's pretty simple, has few options and is still buggy, but I'll refine it over time...

Read here how to use.

in categories  opensource  freecad  permalink:  205   posted on 28.11.2009 1:51
From Yorik
New features in FreeCAD

I'll summarize a bit what we've been doing recently. The biggest feature is the big improvements to the Drawing module. Basically you can now export any 2D view of a 3D Part object, on scale, on a svg sheet. It is already very powerful, you have total control from python to the output svg code, so you can tweak, fill, etc.
In the Draft module, we now have dimension objects working well, and they import/export to dxf format. There is also a first step to implementation of blocks, that is, you can create compounds objects by joining any type of geometry with the Upgrade tool, if no "smarter" object can be created. The downgrade tool will in turn explode compound objects.


in categories  opensource  freecad  permalink:  237   posted on 28.11.2009 1:49
From Yorik
FreeCAD with new icons set

Everything is getting prepared for the next debian freeze in november... We are more or less doing our own feature freeze this month, killing bugs and polishing the look. Here goes a preview of the new icon set of the Part module, and a first sneak peak at the splash screen. Enjoy!


in categories  opensource  freecad  permalink:  262   posted on 28.11.2009 1:48
From Yorik
Short instructions for compiling current FreeCAD svn version on ubuntu

Be aware that the svn version is the version we are working on, so it might contain bugs or even fail to compile.

  1. In case of problem, the complete and detailed instructions are here

  2. Install the following packages: build-essential, python, libcoin60-dev, libsoqt4-dev, libxerces-c2-dev, libboost-dev, libboost-date-time-dev, libboost-filesystem-dev, libboost-graph-dev, libboost-iostreams-dev, libboost-program-options-dev, libboost-serialization-dev, libboost-signals-dev, libboost-regex-dev, libgts-dev, libqt4-dev, qt4-dev-tools, python2.5-dev, libcv-dev, libhighgui-dev, python-opencv, libopencascade-dev, python-qt4, libode1-dev, subversion, cmake

  3. Install the pivy package manually from here, because it is still not in ubuntu repository

  4. Get the FreeCAD source, by pasting the following line in a terminal: svn co https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk freecad

  5. After downloading, in the same terminal, issue "cd freecad"
  6. to go to the freecad directory
  7. Issue "cmake ." to create the compilation files

  8. Issue "make" to compile FreeCAD

  9. After compiling, issue "./bin/FreeCAD" to run FreeCAD. You can also create a shortcut to your freecad/bin/FreeCAD file.

  10. All FreeCAD is contained in its source directory, so to uninstall, simply remove that directory.


in categories  freecad  permalink:  12   posted on 28.11.2008 1:31
From Yorik

Yorik's FreeCAD page

This page contains stuff related to FreeCAD. FreeCAD is an open-source engineering platform. It is basically a 3D modeller, with focus on engineering, like Catia or SolidWorks. It is extremely open and versatile, has many interesting features being developed such as parametric modeling, total python access to any part of the program, and a strong BRep-based modeling kernel. Below, you can find my custom linux builds, and samples of my activity on FreeCAD.

Custom Builds

Note: Several of the following package are non-standard and might not work on your system. Before downloading any of them, please check on the main downlaod page if there isn't a more standard package for your system.
These are FreeCAD builds for 64bits debian-based systems (Debian, Ubuntu and derivates). They have all options enabled and have been compiled with standard optimization for 64bit athlon CPU. If you're looking for other platforms, check the official download page .
Note that these builds don't include openCascade neither SoQt4, which are required to make FreeCAD work. These libraries have both recently been made available in debian repositories, and appear in current Debian and Ubuntu package management systems.

freecad_0.9.2646-1_amd64.deb - for debian squeeze - 20.11.2009
freecad_0.9.2646-1karmic_amd64.deb - for ubuntu karmic - 20.11.2009
freecad_0.8.2237-1jaunty1_amd64.deb - for ubuntu jaunty - 12.09.2009 - this package is also on FreeCAD download page
freecad_0.8.2237-1testing1_amd64.deb - for debian squeeze - 12.09.2009 - this package is also on FreeCAD download page
freecad_0.7.2200-1_amd64.deb - for debian squeeze - 03.07.2009
freecad_0.7-2145_amd64.deb - for debian squeeze / ubuntu jaunty - 16.06.2009

Additional libraries

This is the Pivy package, which is needed in latest FreeCAD packages (rev >= 2087):
python-pivy_0.5.0~svn765-2_amd64.deb - 20.11.2009 - for debian squeeze
python-pivy_0.5.0~svn765-karmic2_amd64.deb - 20.11.2009 - for ubuntu karmic
python-pivy_0.5.0-1_amd64.deb - 03.05.2009 - for debian squeeze (freecad < 0.9)
python-pivy_0.5.0-1_amd64.deb - 03.05.2009 - for ubuntu jauny

Note for Ubuntu users: I compiled this version of FreeCAD against OpenCasCade 6.3, which is available as default in debian squeeze/testing. If the version in your ubuntu repositories is 6.2 (before karmic), you will need to download and install manually the 6.3 version. from the debian repository. Since 6.3 has the same dependencies as 6.2, it will be handled just fine by your package manager. You will just need the foundation and modeling libraries here:
libopencascade-foundation-6.3.0
libopencascade-modeling-6.3.0 .