stl-format

Convert STEP file type to STL

让人想犯罪 __ 提交于 2020-01-02 13:15:24
问题 I want to convert a STEP file into an STL file format using Python. I have looked online and it looks like the best option is to either use FreeCAD or OpenCascade (OCC). However, I am a beginner and do not know where to start from. I did some search online and found this out (a code to convert STEP to OBJ file). Are there any python examples from FreeCAD (based on OCC) to convert STEP files to STL? Where should I start? 回答1: Here's a quick bit of code to start out: import FreeCAD import Part

Load stl file in matlab and convert to a 3D array

大兔子大兔子 提交于 2019-12-25 03:13:53
问题 I have a stl file and I've loaded it in Matlab using stlread function. At this point I have a set of faces and vertices. How can I convert these faces and vertices in a 3D binary array like 512x512x100 array to obtain a binary 3D volume? 回答1: Ah lucky you. I am working with STL files recently and I coded some functions to do exactly this. First, note that you lose precision. STL files represent arbitrary shapes with arbitrary precision and converting it into a volume results in discretization

FreeCAD shape.read() Error: Unsupported format

泄露秘密 提交于 2019-12-13 02:54:10
问题 I am working on a project in which I have to convert a .dae file to .stl file. I am using the code given below import sys sys.path.insert(0, "C:\\Program Files (x86)\\FreeCAD 0.17\\bin\\") import FreeCAD import Part import Mesh shape = Part.Shape() shape.read('INPUTFILE.dae') doc = App.newDocument('Doc') pf = doc.addObject("Part::Feature","MyShape") pf.Shape = shape Mesh.export([pf], 'OUTPUTFILE.stl') I get an error when the interpreter tries to execute the command shape.read('INPUTFILE.dae')

Understanding the mesh created by Qt3D

蓝咒 提交于 2019-12-12 13:40:42
问题 I create a Qt3D mesh like this: Qt3DCore::QEntity *newEntity = new Qt3DCore::QEntity(); Qt3DExtras::QConeMesh *mesh =new Qt3DExtras::QConeMesh(); mesh->setTopRadius(0.2); mesh->setBottomRadius(1.0); mesh->setLength(2.0); for(int i = 0; i < mesh->geometry()->attributes().size(); ++i) { mesh->geometry()->attributes().at(i)->buffer()->setSyncData(true); // To have access to data } newEntity->addComponent(mesh); The created mesh looks like this: Later in the code, I try to export the above mesh

Meshlab: How to turn off the “Unify Duplicated Vertices” prompt?

一个人想着一个人 提交于 2019-12-10 18:32:29
问题 every time I open an STL file with Meshlab, a window pops up and asks, whether I want to "Unify Duplicated Vertices". It is sort of annoying that I always have to press the "OK" button. How can I tell Meshlab that it should always unify them without asking? Thanks! 回答1: You can't. I provided feedback to the developers via Facebook that they should make this an option. 回答2: It is in the upcoming MeshLab version You can try (at your own risk :) ) the prerelease builds; you can found them here:

What is the preferred method for loading STL files in Three.js

﹥>﹥吖頭↗ 提交于 2019-12-09 05:40:49
问题 I'm writing an application that is designed to be used as part of a mechanical design and simulation workflow, and we'd like to be able to use Three.js to load and visualize parts designed in Solidworks, which can be exported as STL (text or binary). ** I fully recognize that one can use something like Meshlab to convert to OBJ or some other format, but this seems like an unnecessary additional step that encumbers the workflow. ** It seems Three.js has good loading solutions for Collada, OBJ,

STL rendering with threejs

喜你入骨 提交于 2019-12-08 10:52:04
问题 I have created a 3D model for printing in 3D an industrial layout. Because I am not used in playing with professional 3D modeler software, I used SketchUp and the result was fine ! Now, I want to reuse the 3D models to make a dynamic visit of the "to-be" installation. I exported each object in Collada format (DAE), and then try to used the collada importer in Threejs. I have around 130 objects that I want to be able to select interactively, but I manage only to load one ... I then get a try

Convert STEP file type to STL

喜欢而已 提交于 2019-12-06 05:45:38
I want to convert a STEP file into an STL file format using Python. I have looked online and it looks like the best option is to either use FreeCAD or OpenCascade (OCC). However, I am a beginner and do not know where to start from. I did some search online and found this out (a code to convert STEP to OBJ file). Are there any python examples from FreeCAD (based on OCC) to convert STEP files to STL? Where should I start? Here's a quick bit of code to start out: import FreeCAD import Part import Mesh shape = Part.Shape() shape.read('my_shape.step') doc = App.newDocument('Doc') pf = doc.addObject

What is the preferred method for loading STL files in Three.js

試著忘記壹切 提交于 2019-12-03 06:53:46
I'm writing an application that is designed to be used as part of a mechanical design and simulation workflow, and we'd like to be able to use Three.js to load and visualize parts designed in Solidworks, which can be exported as STL (text or binary). ** I fully recognize that one can use something like Meshlab to convert to OBJ or some other format, but this seems like an unnecessary additional step that encumbers the workflow. ** It seems Three.js has good loading solutions for Collada, OBJ, UTF-8, VTK, and JSON, but there is no clean STL support example. I saw some things floating around

CSG operation with STLLoader

风流意气都作罢 提交于 2019-12-02 19:43:58
问题 I am trying to perform a boolean operation on an imported STL mesh file using the ThreeCSG.js. Here is the code.. function openFile() { filePath = document.form.selectedFile.value; var loader = new THREE.STLLoader(); loader.addEventListener('load', function(event) { //A simple cube geometry imported from STL file. var geometry = event.content; var cube_mesh = new THREE.Mesh(geometry); cube_mesh.position.x = -7; var cube_bsp = new ThreeBSP(cube_mesh); //Create a sphere var sphere_geometry =