在Mathematica中导入Google Sketchup模型 [英] Importing Google Sketchup models in Mathematica

查看:186
本文介绍了在Mathematica中导入Google Sketchup模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google的Sketchup是一个不错的简单3D对象建模器。此外,Google拥有庞大的


Google's Sketchup is a nice, simple 3D-object modeler. Moreover Google has an enormous warehouse of 3D objects so that you actually don't have to do much modeling yourself if you aren't particularly gifted in this area. Many of the 3D buildings in Google Earth are made with Sketchup. The capability to import Sketchup's SKP files in Mathematica would be very nice, but alas, it doesn't do that yet.

The free version of Sketchup doesn't export to any other formats than the KMZ (Google Earth) and DAE (Collada) formats. Though MMA can read KMZ/KML files it doesn't read those containing 3D objects. DAE files are zipped Collada files and these can be read as XML by MMA's Import. The resulting XML tree is rather complex as is the definition of Collada and getting at the geometry of the object is far from trivial (I managed to coerce the coordinate set of a model from it).

My question is: How to convert SKP files in a clean polygon based structure in Mathematica?

I would prefer an import converter that provides MMA with this import capability, but other routes are welcome too. I'll post the rather indirect method I'm currently using as an answer tomorrow.

解决方案

The route I currently follow involves a number of steps:

  1. Download the SKP file from the Google repository
  2. Open it in the free version of Sketchup
  3. Export it from there as DAE
  4. Convert it to FBX format using the free AutoDesk fbx converter (deep down the page here)
  5. Using the same program, convert the FBX file just created to either DXF or OBJ
  6. Import in Mathematica.

The results are pretty good, though you seem to lose the textures. Figures below show the results. Left: the original Sketchup model, middle: conversion/import via DXF, right: conversion/import via OBJ.

Obviously, you don't want to do this all too often, and for the specific application I'm working on I'd like a solution that users that aren't very computer savvy can handle too.


Update:

As of version 10.4 Mathematica has the capability to import and export DAE files: https://reference.wolfram.com/language/ref/format/DAE.html

这篇关于在Mathematica中导入Google Sketchup模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆