Coder Social home page Coder Social logo

polyscope's People

Contributors

alecjacobson avatar baixiaohub avatar bbrrck avatar danieldugas avatar davidjourdan avatar featherantennae avatar jdumas avatar maidamai0 avatar markgillespie avatar marndorfer avatar mworchel avatar nmwsharp avatar nzfeng avatar otmanon avatar phaedon avatar piercelbrooks avatar romanlarionov avatar serguei-k avatar svenjo avatar tmcarey avatar weshoke avatar xarthurx avatar yousufmsoliman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

polyscope's Issues

The program crashes after I press "Win + D"

System: Win 10
polyscope version: latest

I often use "Win + D" to show the desktop, but the polyscope program crashes after I press this shortcut. Is this a bug?
I use the following code to show the GUI:

polyscope::init();
polyscope::show();

Updating state::lengthscale

Problem: camera view (and probably others at some point) use state::lengthscale on construction to set up a the view. This is a problem because state::lengthscale is constantly changing! For instance, right now, adding views before other objects means the lengthscale changes with each view added.

How should we resolve? Perhaps only permit state::lengthscale to get used as in uniforms, where the new values is utilized every draw iteration. Alternately, call a some function in the structure whenever such a global changes to notify for reconstruct.

Provide option to disable lighting

Lighting can make it difficult to interpret scalar quantities visualized via a color map. Would be helpful to be able to toggle lighting and flat shading (that just directly displays the color map value).

Permutation expected size is off by one

In the permutation setter functions (e.g. setEdgePermutation), you set the size of the index space to be the maximum entry of the permutation. But it appears that the indices in the permutation are supposed to be 0-indexed, which means that the maximum entry is actually 1 less than the desired size

Implement an error and warning system

Goals:

  • Make errors slightly more user friendly than crashing with print-to-terminal
  • Even unexpected exceptions should show up in UI (before terminating)
  • Warnings should be noticeable, so we don't miss them as mountains of text scrolls by

Preserve some kind of state on close

Write out a .polyscope.ini file on exit, and look for one on startup

Things to put in it:

  • Window size
  • Camera parameters
  • imgui stuff

Possible ideas:

  • Include structure/program name, and only load camera when same thing is visualized
  • Break out the camera data to a separate file. This may be useful for auto-generating visualizations

Fix mesh statistics

The statistics printed out for the mesh structure got broken when geometry-central was extracted. Resurrect them in some form!

Build problem

Building polyscope on Ubuntu 18.04.3 with cmake VERSION 3.16.2 according to instructions at http://polyscope.run/building/ produces this error:

[cmake] CMake Error at CMakeLists.txt:13 (add_subdirectory):
[cmake]   add_subdirectory not given a binary directory but the given source
[cmake]   directory "/home/paul/libraries/polyscope" is not a subdirectory of
[cmake]   "/home/paul/st/hello/src".  When specifying an out-of-tree source a binary
[cmake]   directory must be explicitly specified.

I suggest changing
add_subdirectory("polyscope")
to
add_subdirectory("polyscope" "polyscope")
in instructions at http://polyscope.run/building/

AFAIK, it has the same semantics, but may be more tolerant to out-of-tree location of polyscope files.

animation support??

Hi, does the polyscope supports animating now? for instance, how could I use polyscope to check the procedure of the points' removing for a given point cloud continually with only one window?

Use of C-style arrays

Use of C99 arrays can cause problems with compilation (e.g., when using -pedantic and -Werror in clang).

The only example I've run into so far is

template <typename T>
std::string AffineRemapper<T>::printBounds() {
  size_t bSize = 50;
  char b[bSize];
  snprintf(b, bSize, "[%6.2e, %6.2e]", minVal, maxVal);
  return std::string(b);
}

which can be modernized to

template <typename T>
std::string AffineRemapper<T>::printBounds() {
  const size_t bSize = 50;
  std::array<char,bSize> b;
  snprintf(b.data(), bSize, "[%6.2e, %6.2e]", minVal, maxVal);
  return std::string(b.data());
}

(Though there may be others.)

Create some kind of unified quantity manager

Right now its looking like the logic to manage quantities will be duplicated in every structure. This is bad; can we create a general purpose "quantity manager" to handle all of these?

polyscope in jupyter notebooks crashes python

Hi,

I just tried polyscope within python on Windows using the ipython terminal, jupyter notebook and jupyter lab. In all cases, polyscope works well and is quite impressive. But when I try to close the polyscope window, it always crashes python. Are there any settings I can change to address this? I am assuming it is related to the opengl backend, yes?

Cheers,
Michael

Add faux transparency

There are a lot of tricks for rendering transparency; this one is particularly friendly to the rasterization pipeline and could work well in Polyscope (also because it nicely highlights contours):

https://observablehq.com/@rreusser/faking-transparency-for-3d-surfaces

“Cartoon edges” might be replaced with simple edge based silhouettes (i.e., compare the sign of the dot product of the normal with the eye for the 2+ triangles touching an edge), since the former works well only for well-tessellated surfaces.

Shader issue with the Curve Network structure

I'm have a weird issue with Curve Network: the embedding of nodes seems to be wrong.

output

My test: I create a simple curve network with small segments starting at mesh vertices and going inside the mesh. What we see in the video is just the first nodes.
The issue is that the curve tips should coincide with the mesh vertices (which is not the case).

If you look at the coordinates (selection windows), they are exactly the same. It looks like it's only a draw issue.

(tested on macOs)

Handle centering meshes automatically

Provide some nice way of handling meshes which are far from the origin. Perturbing vertex positions is NOT the right idea, use a view transform instead.

Should this apply for all structures? Perhaps we want "center to bounding box" instead.

Highlight selected objects

More generally, provide a nice facility for highlighting.

Probably want to do this with shader tricks, rather than geometry tricks. Perhaps stencil --> blur --> blend?

stack alignment of matrial bindata causes segmentfault

  • code

polyscope::init();
polyscope::show();

  • output

[polyscope] Backend: openGL3_glfw -- Loaded openGL version: 4.1 ATI-3.5.5
[1] 5910 segmentation fault ./demo

  • call stack

exception: stack_not_16_byte_aligned_error
stb_image.h: stbi__load_and_postprocess_8bit
stb_image.h: stbi__loadf_main
stb_image.h: stbi_loadf_from_memory
engine.cpp: loadDefaultMaterial
engine.cpp: loadDefaultMaterials
engine.cpp: allocateGlobalBuffersAndPrograms

  • environment

MacOS Catalina 10.15.3, compiler: apple clang v11

  • workaround

comment out following material load in engine.cpp:

loadDefaultMaterial("mud");
loadDefaultMaterial("ceramic");
loadDefaultMaterial("jade");
loadDefaultMaterial("normal");

Port to VCPKG

Hi, thx for this great lib. Could you also add a port to VCPKG dependency manager for easier usage? Please find attached how the port should look like for your library. You only have to submit a PR to VCPKG with the attached folder inside ports folder. It is almost working, all you need to do is include an install build target to CMake scripts.
polyscope.zip

allowReplacement not exposed through public interface

Trying to set an existing quantity with add*Quantity yields an error message that cannot be resolved by setting the requested option. For instance, running SurfaceMesh::addVertexScalarQuantity twice yields an error message

[ERROR] Tried to add quantity with name: [quantity], but a quantity with that name already exists on the structure [mesh]. Use the allowReplacement option like addQuantity(..., true) to replace.

but there is no way to pass this option through addVertexScalarQuantity.

Sort out surfacemesh counts/subsets API

Right now there's a bit of a zoo of count and subset quantities in surface_mesh.h. All of these share the general idea that some subset of mesh elements are selected, possibly with a scalar associated with the selected elements.

What's the right API here? What should these functions be called?

The imgui cmake mac fix breaks on -Werror=... flags

The added line to deps/imgui/CMakeLists.txt

string(REPLACE " -Werror" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")

breaks builds when the flags contain -Wall -Werror=return-type, this gets mangled to -Wall=return-type

Suggested fix:

string(REPLACE "-Werror=" "-Wno-error=" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE " -Werror" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")

updateVertexPositions does not update wireframe

Just calling updateVertexPositions does not seem to properly update the GL buffers storing the data for wireframe rendering. Instead, the original wireframe gets drawn (and clipped against the silhouette of the new geometry?). Here's an example:

bad_wireframe

Color Quantities on Curve Networks don't render colors (Python API)

Hi @nmwsharp ,

Thank you for this excellent package!

I was not able to get the colors to render in the curve network example.

As written in the example in the documentation, I ran the exact code (with the addition of ps.init())

import numpy as np
import polyscope as ps

# register a curve network
N_node = 100
N_edge = 250
nodes = np.random.rand(N_node, 3)
edges = np.random.randint(0, N_node, size=(N_edge,2))
ps_net = ps.register_curve_network("my network", nodes, edges)

# visualize some random colors per-node
# vals_node = np.random.rand(N_node, 3)
# ps_net.add_color_quantity("rand vals", vals_node)

# visualize some random colors per-edge
vals_edge = np.random.rand(N_edge, 3)
ps_net.add_color_quantity("rand vals2", vals_edge, defined_on='edges')


# view the network with all of these quantities
ps.init()
ps.show()

and the result looks like this:
image

I am using the Python API (Python 3.6.8), Ubuntu 18.04. I installed the pre-compiled wheels via python -m pip install polyscope.

Did I miss something?

Thanks!
-Rana

Ensure all significant UI interactions trigger redraw

Right now, there are lots of small bugs where changing some setting in the quantity option pane doesn't trigger a redraw when it should (e.g., changing bounds on colormap). This is caused by missing requestRedraw() calls.

Part 1 is do a quick audit to identify and fix as many of these as possible.

Part 2 is to make these bugs less common in the future. There's probably no magic solution, and this will probably be a recurring issue. But we should do what we can, like abstracting more things behind helpers, to make it less common.

Ensure all internal float types use double precision

General strategy is to use double types internally everywhere, to avoid subtle situations (like IO) where a loss of precision occurs in user data.

We've been shuffling types internally, so make sure no floats (or glm::vec3) slipped through.

Issue with autoscaleStrucutre and relativeValue

When using the autoscaleStrucutres option, there may be an issue with the relativeValue computations (state::lengthScale might not be updated properly). For instance, if you attach an ambient vector field to a structure, the length and radius slider limits are super small (when you scale down a huge object to the unit cube thx to the autoscale).

UI

Would it be possible to integrate a platform like QT python? I would like to add some buttons etc.

addQuantity does not work as advertised

The snippet on the landing shows these lines of code

// Add a scalar and a vector function to the mesh
polyscope::getSurfaceMesh("my mesh")->addQuantity("my_scalar", scalarQuantity);
polyscope::getSurfaceMesh("my mesh")->addQuantity("my_vector", vectorQuantity);

but should really be something like addVertexScalarQuantity or addFaceVectorQuantity, etc. (This can cause confusion when trying out polyscope for the first time.)

point cloud not visible (python)

I've tried the basic point cloud visualization example from the docs for python:

import numpy as np
import polyscope as ps
ps.init()

points = np.random.rand(100, 3)
ps_cloud = ps.register_point_cloud("my points", points)
ps.show()

However, the window that is created looks like this.
I've also tried to adjust the radius, but this doesn't change anything.

On the console I get the following output:

[polyscope] Backend: openGL3_glfw -- Loaded openGL version: 3.3 (Core Profile) Mesa 19.2.8

I've installed via the conda command for python 3.6.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.