3D scanner data to FreeCAD file

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
jwackito
Posts: 3
Joined: Tue May 14, 2013 5:20 pm

3D scanner data to FreeCAD file

Post by jwackito »

Hi guys. I'm working on a 3D scanner as a science project based on this one
http://hackaday.com/2013/02/14/3d-scann ... -in-a-day/

The idea is to write the dots position directly into a FreeCAD file. There is a python library that allow me to do this? I mean, a native python library that allow me to create a FreeCAD document, add the dots position and save the document without using freecadcmd feature?

Thanks in advance.
Regards from Argentina.
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: 3D scanner data to FreeCAD file

Post by shoogen »

Instead of running freecadcmd you should be able to run use FreeCAD as a normal python module. But is not a 'seperate' library, you would FreeCAD by itsself.

FreeCAD can also import Point clouds from a simple text file. When dealing with data from a MS kinnect, the fact that points can't have an individual color might be considered a drawback.
jwackito
Posts: 3
Joined: Tue May 14, 2013 5:20 pm

Re: 3D scanner data to FreeCAD file

Post by jwackito »

Thanks shoogen. Maybe the point cloud text file is a better approach. Have you a reference about the file format?
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: 3D scanner data to FreeCAD file

Post by shoogen »

one point per line. axes separated by whitespace. Filename extension '.asc'

Code: Select all

# Points001 Number of points: 3
0 0 0
1 2 0
-2 1 0
if you are familiar with regular expression, you might want to have a look at the import routine.
https://github.com/FreeCAD/FreeCAD_sf_m ... os.cpp#L62 PointsAlgos::LoadAscii(PointKernel &points, const char *FileName)
jwackito
Posts: 3
Joined: Tue May 14, 2013 5:20 pm

Re: 3D scanner data to FreeCAD file

Post by jwackito »

Thanks again shoogen. The format seems sweet and simple, just the way I like it... Definitely, RegExps are not one of my strong points but the code seems to accept points with exponential notation! Nice... I will keep you informed about my process if you are interested.

Best regards and thanks again.
valioni
Posts: 1
Joined: Mon Nov 03, 2014 5:37 pm
Location: Romania

Re: 3D scanner data to FreeCAD file

Post by valioni »

it also works exporting the point cloud from meshlab with the extension .xyz - without the normals (really important) and changing the extension to .asc (used save as in notepad)

-but freecad inserts the point cloud in mm no matter what units you use (tried metric) - big problem with scaling because it doesn't work with point clouds - so you have to draw the profile you're interested in and scale that

using freecad 0.16.5018 on win7 64, meshlab 1.3.3
GumbleTea
Posts: 6
Joined: Thu Dec 29, 2016 12:48 pm

Re: 3D scanner data to FreeCAD file

Post by GumbleTea »

Hello, I decided not to start a new topic about my problem. I'm trying to use freeCAD with scanned model. I scan using Kinect and tryed Scanect and Demo Artec Studio software. I managed to get quite fine result in both, but when i'm trying to import it to freeCAD it's absolute mess. What am I doing wrong?
chrisb
Veteran
Posts: 53945
Joined: Tue Mar 17, 2015 9:14 am

Re: 3D scanner data to FreeCAD file

Post by chrisb »

GumbleTea wrote:What am I doing wrong?
A big mistake was that you didn't make clear what you have done, nor what exactly the problem is. "An absolute mess" shows the direction but the world of mess is very wide. I guess you expeced more advice than "Clean up the mess!" so you should at least tell us:
- What was the input to FreeCAD
- What was the result
- What did you expect
An image could be helpful.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: 3D scanner data to FreeCAD file

Post by jmaustpc »

FreeCAD version data could be also relavent.
GumbleTea
Posts: 6
Joined: Thu Dec 29, 2016 12:48 pm

Re: 3D scanner data to FreeCAD file

Post by GumbleTea »

Sorry for dissapearing for a long time. For that issue, I've asced Artec support and they explained me how to clean the mesh before exporting. Now it works fine.
Post Reply