Converting Points into a Mesh

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
AndrewC
Posts: 1
Joined: Thu Mar 17, 2016 5:32 pm

Converting Points into a Mesh

Post by AndrewC »

Hi,
I am a new Freecad user, but not new to CAD in general.
The difficulty that I have is that I get sent ground survey drawings with a series of points or crosses in 3d indicating their position and level. This is normally in Autocad format or dxf which I can import into FreeCAD.

I would like to convert this into a mesh so that I can more easily work with it.

Is there a simple way to do this?
Thanks

OS: Windows 8.1
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.15.4671 (Git)
Branch: releases/FreeCAD-0-15
Hash: 244b3aef360841646cbfe80a1b225c8b39c8380c
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
User avatar
r-frank
Veteran
Posts: 2180
Joined: Thu Jan 24, 2013 6:26 pm
Location: Möckmühl, Germany
Contact:

Re: Converting Points into a Mesh

Post by r-frank »

Hello AndrewC.

Welcome to FreeCAD and the forum.

We had some time ago an interesting discussion in the german sub-forum about this.

You can import points with the points-workbench.
Updating to a quite recent 0.16 development snapshot und using the linked script you could convert these points to a mesh object.

Hope this helps for first steps ...

Roland
Deutsche FreeCAD Tutorials auf Youtube
My GrabCAD FreeCAD-Projects
FreeCAD lessons for beginners in english

Native german speaker - so apologies for my english, no offense intended :)
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Converting Points into a Mesh

Post by ickby »

Hello,

Roland already directed you to the correct thread, but actually to a code snippet which approximates the points with a bspline surface. This is in most cases more helpful and more viable than a mesh, but just in case you really need a mesh here is the snippet for doing so (from a few posts earlier than the one linked by roland):

Code: Select all

import ReverseEngineering as Reen
points=App.ActiveDocument.terrain.Points
mesh=Reen.triangulate(points, 10000, 3.5)
import Mesh
Mesh.show(mesh)
This needs a recent git build / developer version or linu daily ppa.
tkatsuki
Posts: 5
Joined: Fri Nov 27, 2015 2:45 pm

Re: Converting Points into a Mesh

Post by tkatsuki »

Hi, I'm trying to do this with the FreeCAD version 0.17.10033 but it gives me the following error. What am I doing wrong?

>>> mesh=Reen.triangulate(points, 10000, 3.5)
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: 'module' object has no attribute 'triangulate'

OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10033 (Git)
Build type: Release
Branch: (detached from f33c7b3)
Hash: f33c7b3f00f8625cf2821c23a74952d4ab671827
Python version: 2.7.13
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 7.0.0

Thanks,

Takeo
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Converting Points into a Mesh

Post by wmayer »

File "<input>", line 1, in <module>
AttributeError: 'module' object has no attribute 'triangulate'
Apparently your Mac build doesn't link the pcl library. FreeCAD uses this algorithm to create the mesh: http://docs.pointclouds.org/trunk/class ... ation.html
tkatsuki
Posts: 5
Joined: Fri Nov 27, 2015 2:45 pm

Re: Converting Points into a Mesh

Post by tkatsuki »

I see. It worked on my Windows 64-bit environment. Thanks wmayer.

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10031 (Git)
Build type: Release
Branch: master
Hash: 0a6b382d718864b4733c58816b3fd111583499ca
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0

Takeo
stefankorisnik3
Posts: 101
Joined: Sun Jul 24, 2022 12:49 pm

Re: Converting Points into a Mesh

Post by stefankorisnik3 »

Same error here

Code: Select all

Traceback (most recent call last):
  File "<input>", line 1, in <module>
AttributeError: module 'ReverseEngineering' has no attribute 'triangulate'

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.29177 (Git)
Build type: Release
Branch: releases/FreeCAD-0-20
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.2
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * CurvedShapes 1.0.3
  * Curves 0.5.2
heda
Veteran
Posts: 1348
Joined: Sat Dec 12, 2015 5:49 pm

Re: Converting Points into a Mesh

Post by heda »

https://github.com/FreeCAD/FreeCAD/releases/tag/0.20
the portable..., filesize hints more batteries included...
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Converting Points into a Mesh

Post by adrianinsaval »

or just inferior compression ;) AFAIK that one is the same as the installer. The version at https://github.com/FreeCAD/FreeCAD-Bund ... s/tag/0.20 should be a different build though.
@uwestoehr @looo does any of these builds have pcl enabled?
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Converting Points into a Mesh

Post by uwestoehr »

This thread is 5 years old. Please open a new one with a proper description what you did to get the bug.
Post Reply