3d

Get points enclosed by a 3d polygon

我与影子孤独终老i 提交于 2020-01-02 09:28:07
问题 I have a polygon that lies on a 3D plane. i want to get all points enclosed by this polygon.can anyone help me ? i can make a 3D scan line algorithm by replacing the scan lines by planes and get the intersection of planes with my polygon but i want a faster solution. Thanks in advance. 回答1: "yes it's a convex 3p polygon ,but it all its points lie in the same plane" In that case - just convert the polygon and all the test points into 2D local coordinates of the plane and use a 2D algorithm: 2D

good data structure for triangular mesh [closed]

心不动则不痛 提交于 2020-01-02 08:45:29
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed last year . I am looking for a memory-efficient yet convenient data structure for a 3D mesh or face-set consisting of triangles. Currently I am using this 'classical' structure: a list of points, and a list of triangles. Each point has a X, Y, and Z value. Each triangle has three indices

Am I missing step in building/installing VTK-5.4 with Python2.6 bindings on Ubuntu 9.04?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-02 07:49:09
问题 I successfully built and installed VTK-5.4 with Python bindings from source. Yet, when I try to import VTK in python it gives the following Traceback error File "", line 1, in File "/usr/local/lib/python2.6/dist-packages/VTK-5.4.2-py2.6.egg/vtk/ init .py", line 41, in from common import * File "/usr/local/lib/python2.6/dist-packages/VTK-5.4.2-py2.6.egg/vtk/common.py", line 7, in from libvtkCommonPython import * ImportError: libvtkCommonPythonD.so.5.4: cannot open shared object file: No such

matplotlib not displaying intersection of 3D planes correctly

末鹿安然 提交于 2020-01-02 07:40:08
问题 I want to plot two planes and find their intersection line, but I get this result, where it's impossible to tell where they intersect, because one plane overlays the other. A 3D projection should hide the non-visible part of the plane, how do I attain this result using matplotlib ? You can clearly see that these to plains should intersect. Here's the code I've used to get this result import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D values = range(-10,

Java 3D Hello World - Jar freeze

社会主义新天地 提交于 2020-01-02 07:30:13
问题 Hi guys I'm following this tutorial to build my first Java 3D application. I included in my project the java3D libraries and my DllLoader class that extracts (from the classpath to the jar's location) and loads the j3dcore-ogl.dll : public class DllLoader { private DllLoader() { } public static void extractAndLoad(String dll) throws IOException { int aux = dll.lastIndexOf('/'); if (aux == -1) { aux = dll.lastIndexOf('\\'); } File dllCopy = new File((aux == -1) ? dll : dll.substring(aux + 1));

Operate on slices of 3D image in SimpleITK and create new 3D image

隐身守侯 提交于 2020-01-02 07:26:09
问题 I have a 3D image read in to SimpleITK (using python) from a NIfTI file, take each axial slice, do something with it and re-insert the new 2D slice into a 3D volume with the (hopefully) appropriate dimensions. For example, output = sitk.Image(original.GetSize(), sitk.sitkFloat32) output.CopyInformation(original) for z in numpy.arange(original.GetDepth()): image = original[:,:,z] << Do Something in SimpleITK>> << Produce a new 2D image = newimage >> output[:,:,z] = newimage The final step is

Combining three.js and KineticJS - 3D cube

亡梦爱人 提交于 2020-01-02 07:15:09
问题 I am trying to add a 3D cube to Kinetic JS canvas to show the x,y,z rotation. I found this article http://www.tonicodes.net/blog/combining-three-js-and-kineticjs. I worked with version 3.8, When I tried to follow the example using the version 4 of Kinetic JS I got this error, Unable to get property 'appendChild' Any suggestions, to solve it or a better method to include 3D cube in the canvas. complete project http://jsfiddle.net/user373721/hXw6D/1/ I found this perfect example http:/

Vector math, finding coördinates on a planar between 2 vectors

安稳与你 提交于 2020-01-02 07:06:54
问题 I am trying to generate a 3d tube along a spline. I have the coördinates of the spline (x1,y1,z1 - x2,y2,z2 - etc) which you can see in the illustration in yellow. At those points I need to generate circles, whose vertices are to be connected at a later stadium. The circles need to be perpendicular to the 'corners' of two line segments of the spline to form a correct tube. Note that the segments are kept low for illustration purpose. [apparently I'm not allowed to post images so please view

Difference between visualizing a mesh and its point cloud

旧城冷巷雨未停 提交于 2020-01-02 06:42:07
问题 I'm working with PCL and a Mesh editor (MeshLab). I'm interested in importing my meshes to PCL to do some 3D processing. I've a mesh model in ply format. When I load the model with the code: PointCloud<PointXYZRGBA>::Ptr cloud (new PointCloud<PointXYZRGBA> ()); pcl::io::loadPLYFile<pcl::PointXYZRGBA>(argv[1], *cloud); and I visualize it as a point cloud: visualization::PCLVisualizer viewer ("Model"); viewer.addPointCloud (cloud,"model"); the geometry is different from loading and visualizing

How to animate and propertly intepolate a QML rotation transform in 3D

こ雲淡風輕ζ 提交于 2020-01-02 06:38:32
问题 This code sample here: import QtQuick 2.0 Item { width: 200; height: 200 Rectangle { width: 100; height: 100 anchors.centerIn: parent color: "#00FF00" Rectangle { color: "#FF0000" width: 10; height: 10 anchors.top: parent.top anchors.right: parent.right } } } Will produce this output: Now I want to apply a 3D rotation from the center of this green rectangle. First, I want to rotate on X by -45 degrees (bowing down), then on Y by -60 degrees (turning left). I used the following c++ code