Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sjk/meshcat #31

Merged
merged 2 commits into from
Apr 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions src/visualize.jl
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
global vis = nothing

function init_vis()
global vis
if vis == nothing
vis = Visualizer()
open(vis)
end
vis
end

function visualize(p::AbstractPrimitive, algorithm=MarchingCubes(),
res_start=1, res_scale=0.5, res_iterations=5)

function visualize(m::AbstractMesh, algorithm=MarchingCubes(),
resolution=1)

# first visual
vis = Visualizer()
m = HomogenousMesh(p, resolution=res_start, algorithm=algorithm)
open(vis)
vis = init_vis()
delete!(vis) # clear visualizer
setobject!(vis, m)
res = res_start
for i = 1:res_iterations
res = res*res_scale
m = HomogenousMesh(p, resolution=res, algorithm=algorithm)
delete!(vis)
setobject!(vis,m)
end
end