How to import Open3D o3dtut without error

Writing this blog stems from a question from a blogger. At first I thought it was a problem with environment configuration or software version. When I really tried to solve it, I found that it was not.

problem

When using Open3D meshing, o3dtut is needed, and the error is as follows:

mesh = o3dtut.get_knot_mesh()
NameError: name ‘o3dtut’ is not defined

solve

1. Import o3dtut

import open3d_tutorial as o3dtut

2. Add the open3d_tutorial.py class

open3d_tutorial.py is in the Open3D source code: https://github.com/seminar2012/Open3D/blob/master/examples/Python/open3d_tutorial.py

After step 1, an error will be reported

import open3d_tutorial as o3dtut
ModuleNotFoundError: No module named 'open3d_tutorial’

You can see that the file directory in open3d_tutorial is hard to write. Build a directory structure like this
Insert picture description here

3. Build the directory structure

Insert picture description here

4. Successfully run

Insert picture description here

Guess you like

Origin blog.csdn.net/qq_40985985/article/details/110917333