O3d - Python3 Open3d Webrtc #6745
Replies: 1 comment 1 reply
|
!/usr/bin/env python3 -- coding: UTF-8 --from solid2 import * print ('Environment Set; webrtc ip: '+ip+':'+port) |
|
!/usr/bin/env python3 -- coding: UTF-8 --from solid2 import * print ('Environment Set; webrtc ip: '+ip+':'+port) |
Uh oh!
There was an error while loading. Please reload this page.
Hello all; Jayson -

I have been working on a python3 script that runs on my Google VM that should display an .stl it makes. However, the webrtc portion of Open3d Visualization Does not fully work because the localhost:8087 is not on the web.....it is open on the vm though...
Here is my code for this portion of the program:
`#!/usr/bin/env python3
-- coding: UTF-8 --
from solid2 import *
from jupyterscad import view
import open3d as o3d
import os
os.environ['EGL_PLATFORM'] = 'surfaceless'
os.environ['OPEN3D_CPU_RENDERING'] = 'true'
os.environ['LIBGL_ALWAYS_SOFTWARE'] = 'true'
#os.environ['WEBRTC_IP'] = '34.102.96.137' #vm ip
os.environ['WEBRTC_IP'] = '127.0.0.1'
os.environ['WEBRTC_PORT'] = '8087'
d = cube(5) + sphere(5).right(5) - cylinder(r=2, h=6)
scad = (scad_render(d))
view(scad, outfile='/var/www/design.stl')
mesh = o3d.io.read_triangle_mesh("../design.stl")
mesh = mesh.compute_vertex_normals()
o3d.visualization.webrtc_server.enable_webrtc()
o3d.visualization.draw(mesh)`
I am basically looking for a way to adapt my code to use the localhost of the vm so as to be served aswell on my static ip and domain name.
All reactions