vertices

Leaflet - draw polyline vertices only

浪尽此生 提交于 2019-12-21 21:04:03
问题 The title is quite clear, I'm using Leaflet and I need to show only the vertices of a polyline. For exemple see this image : Currently I can only have the black line, I'd like only the red squares. Using markers is not an option for performance issue, my lines can be huge (500 000 vertices) and the use of smoothFactor is a need. Is that possible? If not, does someone knows a plugin that does that, or have a hint on how could I do that by extending the Polyline class? 回答1: What you could do

Best Algorithm to find the edges (polygon) of vertices

半世苍凉 提交于 2019-12-21 05:11:19
问题 I have a large array of vertices, some of them are edges, some are redundant (inside the shape) and I want to remove those. The simplest algorithm I could think of is checking one by one if they hit the shape formed by the others. But it should be a very slow algorithm. I thought about picking one from the edge (the one farthest from origin per example) and calculate the longest path from this start... should get the edge path, right? Any suggestion? 回答1: The trick with polyhedral algorithms

Three.js: Get updated vertices with morph targets

纵饮孤独 提交于 2019-12-20 03:13:30
问题 I've got some morph targets working: https://jsfiddle.net/3wtwzuh3/2/ (Use the slider control to see the morph) However, I'd like to be able to access the new positions of the vertices after the morph. If you notice in the linked example, I am displaying the y coordinate of the first vertex of the cube and it is not updating! // This Y vertex doesn't seem to update! elInfo.innerHTML = geometry.vertices[0].y; Is it possible to get the new positions? I've tried setting all sorts of flags and

Draw cube vertices with fewest number of steps

依然范特西╮ 提交于 2019-12-14 04:22:23
问题 What's the fewest number of steps needed to draw all of the cube's vertices, without picking up the pen from the paper? So far I have reduced it to 16 steps: 0, 0, 0 0, 0, 1 0, 1, 1 1, 1, 1 1, 1, 0 0, 1, 0 0, 0, 0 1, 0, 0 1, 0, 1 0, 0, 1 0, 1, 1 0, 1, 0 1, 1, 0 1, 0, 0 1, 0, 1 1, 1, 1 I presume it can be reduced less than 16 steps as there are only 12 vertices to be drawn You can view a working example in three.js javascript here: http://jsfiddle.net/kmturley/5aeucehf/show/ 回答1: Well I

copying edges with adjacent vertices and their properties using BOOST

北战南征 提交于 2019-12-13 07:49:05
问题 I'm trying to copy an edge from a graph and add it to another (with all his vertices and properties), I make something like: if (!dataG.empty()) { auto const& gr = dataG.front(); // firslt graph in G_list auto ep = edges(gr).first; //first edge in gr vertex_t from = source(*ep, gr); vertex_t to = target(*ep, gr); boost::property_map<Graph, int VertexProperties::*>::type idmap = boost::get(&VertexProperties::id, testg); boost::property_map<Graph, int VertexProperties::*>::type labelmap = boost

three.js - how do I get the vertices of an object?

Deadly 提交于 2019-12-13 04:43:59
问题 I am trying to import a model from blender and loop through all vertices. I am using the colladaloader for the import. It all works fine and the model is loading. But I do not want the faces of the model - I only need the vertex positions for my purposes. Can anyone tell me if there is a way to do this? e.g. a loop that loops through all vertices of the imported model? Thanks, Tomo 回答1: If geo represents your geometry: for (var i = 0; i < geo.vertices.length; i++) { var v = geo.vertices[i]; /

Labels on only root and terminal vertices in igraph (R)?

北战南征 提交于 2019-12-12 20:09:05
问题 inst2 = c(2, 3, 4, 5, 6) motherinst2 = c(7, 8, 2, 10, 11) km = c(20, 30, 40, 25, 60) df2 = data.frame(inst2, motherinst2) df2 = cbind(df2, km) g2 = graph_from_data_frame(df2) tkplot(g2) how would I approach adding labels to exclusively my root and terminal vertices in a graph? I know it would involve this function, but how would you set it up? Assuming the graph object is just called 'g', or something obvious. vertex.label = 回答1: The solution from @eipi1o is good, but the OP says "I'm finding

DirectX 11 Vertices Coordinates

依然范特西╮ 提交于 2019-12-12 01:01:36
问题 I'm working on my first C++ and DirectX 11 project where my current goal is to draw a colored triangle on the screen. This has worked well without any problems. However, there's one part that I would like to change, but I don't know how. I've tried searching for a solution but I havn't found any yet, and I guess that the reason is because I don't really know what I should search for. Currently I set up my triangles 3 vertices like this: VertexPos vertices[] = { { XMFLOAT3( 0.5f, 0.5f, 1.0f )}

copying edges with their vertices and properties using BOOST

被刻印的时光 ゝ 提交于 2019-12-11 23:45:24
问题 I want to copy edges with their vertices and properties from dataG.front(), and add it to testg , I tried what I found in "Accessing bundled properties" section http://www.boost.org/doc/libs/1_57_0/libs/graph/doc/bundles.html but it isn't working for me. PS: dataG is a vector of graphs. typedef std::pair<edge_iter, edge_iter> edge_pair; Graph testg; if (!dataG.empty()) { auto const& gr = dataG.front(); for (edge_pair ep = edges(gr); ep.first != ep.second; ++ep.first) //ep edge number { auto

What does -431602080.000000 value in GLMmodel vertex means?

我与影子孤独终老i 提交于 2019-12-11 18:19:39
问题 I use a GLMmodel object in order to represent a Google Sketch Up model in a C++ program. These objects have a member (vertices) that contains a list of all the vertices of the object in a way like this: [GLfloat x component of vertex 1, GLfloat y component of vertex 1, GLfloat z component of vertex 1, GLfloat x component of vertex 2...]. When I read all these values I get small numbers for all of them except for the first three ones (the coordinates of the first vertex) which are all three