-
Posts
393 -
Joined
-
Last visited
-
Days Won
32
Content Type
Profiles
Forums
Downloads
Gallery
Everything posted by vugie
-
[sarcasm Mode On] Better or just more modern? [sarcasm Mode Off]
-
Here is a method: You have to check Draw Mode (triangles or quads) in order to know hoe to interpret Indices (refer to mesh example in LV). It's also good to check Normal Binding Mode (whether normals are defined per vertex, per face or not binded at all).
-
Ok. As I said it is only possible when object hit with mouse is a mesh (you can check with trying to downcast reference of object's drawable to mesh class and checking for an error). You are loading an external file, so you cannot be sure that it contains normal data (normals cause that objects look smoother). Lets assume that it does not contain such data and you have to calculate it from face orientation. So you have to find a face clicked with mouse. PickPoint method gives you only 3D coordinates not related to geometry. Use "Vertex Array" and "Indices" properties of the mesh to get information about faces of clicked object and than search for the face which contain point you acquired with PickPoint. When you find is calculation normal is as simple as calculating cross product of two vectors, but searching for the face is not so simple. PickPoint does this behind the scenes, but unfortunately it doesn't provide this information. There are a lot of methods to find a face: from relatively simple and slow to complex and fast. The simplest is searching faces one by one checking whether it contain a point (also few methods for that). What to use is dependent on complexity of your geometry, frequency of performing the search and any additional information you know about the geometry.
-
I don't understand the context... All the normal data for the mesh is the data you provide during mesh inititialization (one normal vector either per vertex or per face). You may also use respective property to get Normal Array. It is not possible for standard objects like sphere or cone. If you have per vertex binding and you want to determine normal of point which lays between vertices, you have to make a weighted sum of normals form 3 (for triangles) or 4 (for quads) closest vertices. You have to remember that when the object is rotated or not uniformly scaled, norwar vectors should be transformed as well.
-
Look at the window at the place where you are. Remember the direction. Now stand on your head and look at the same direction. What is the difference between these views? The "Up direction"!
-
"Setup Camera" is a method (by means of Invoke Node) of 3D Picture Control. It sets position of camera and direction of view, so that you may make buttons for moving camera around your object. Normally it can be done with setting proper camera mode (spherical, flying, etc.) and rotating scene with mouse without any additional coding, but it requires using modifier keys or middle mouse button (so I guess it's limited for touch panel to rotating which is realized with LMB).
-
You may use "Setup Camera" method of 3D Picture Control in conjunction with respective buttons for scrolling and zooming. Or alternatively buttons for switching between zoom/pan/any_other_functionality and Mouse Down and Mouse Up events, but I don't know whether these events work with touch panel.
-
I made something like this, but not very general - just for one case. I was minimizing sum of squared euclidean distances from measurement point to curve and from error rectangle to curve (weighting both - weight for distance from error rectangle was higher). I coded it using my genetic algorithm (Waptia), but it should be doable also with Unconstrained Optimization.vi.
-
Unbelivable! Maybe because it is just one word...
-
How to derive the script's own directory path?
vugie replied to Gan Uesli Starling's topic in LabVIEW General
Except for situation when VI was dynamically called from outside the EXE... A lot of things to check to have general way. Looks like OpenG package needs to be updated... -
How to derive the script's own directory path?
vugie replied to Gan Uesli Starling's topic in LabVIEW General
There is an OpenG VI "Current VIs Parent Directory" which abstracts from running environment. It uses same method as asbo showed, but strips the path until it becomes valid directory name. Optionally it adds some relative path. Veeeery useful. BTW, Jim, what happened to your "OpenG VIs I couldn't live without" series? -
You need Scripting Workbench and/or PMS Assistant. I drilled into this topic a little bit and here is VI to read all tag names from VI of given reference. It gets only persistent tags. LV 8.2 - it uses resource manager library, I'm not sure wether it is in same place in newer versions. Get VI Tag Names.vi
-
I suspected sth like this... And how do you read "available memory" and "program usage"?
-
Hi I have laaaarge binary file (array of clusters). Not possible to load at once. Read from binary file generates an error (error code 2) and message box "Not enough memory to complete operation" pops up. Ok, I want to load as much as possible (with reasonable margin) - so how to determine what is the largest array I may allocate (at the moment, not generally). What I already tried: Memory manager functions to determine free memory (AZFreemem, AZMemStats) - always return 0 (I found that they are Mac specific functions) Trying to allocate big memory block with memory manager decreasing its size each time when it was unsuccessful (and freeing it again on success) - the size of largest allocatable memory block acquired that way was always much larger than array I was able to initialize (attempt to initialize to large array causes pop up message, but no any programmatic feedback) Sequentially decreasing the array size provided to "Read from Binary File" and parsing error cluster - pops up message each trial (unavoidable) and sometimes does not generate any error, but array loaded is empty So what is best method to programatically determine largest possible array? LabVIEW 8.2
-
IP.Board costs $. So why they provide such a #@$%^%$#@$$? It's hardly belivable that users don't press them to fix such an issue for such an important functionality... It's so hardly belivable that I would suppose that search function is simply not well configured on LAVA...
-
If you want to see REALLY zoomable interface watch this.
-
I guess that one parameter may be used in multiple functions. I've implemented something similar using my Waptia genetic optimization library. All you need is to prepare VI which calculates sum of squared distances for all curves for all measurement points and for given set of parameters (well, inverse of the sum, because this is a fitness function). The parameters must be scaled to 0..1 range. Another solution would be to use standard curve fitting, but to create virtual curve which uses part of its domain for each real curve.
-
[CR] UI Tools addon: Control class
vugie replied to Francois Normandin's topic in Code Repository (Certified)
François, could you please save your tools (and possibly control packages) in as low version as possible? I'm still with 8.2 and I know that many people still do something in 7.0 (only packages would be usable for them, because of LVOOP). Besides that I would like to see the code and find out the reason of "pure white" bug (which is propably BitMan's fault, so mine ) -
I'm just playing with SWIG, whuch is able to parse C/C++ headers and create XML with description of all types and functions. From such XML it should be possible to programatically create typedefs and even wrapper VIs using scripting. I have no usable results yet, but it is promising - I want to use it to automatically create C wrappers for C++ DLLs.
-
I've used Maxima for few times to perform some sybolic calculations (mainly differenciation of matrix equations) and it went quite smootly. I didn't use Mapple, so I can't compare them. Not so long ago I used Scilab a lot. It's open source Matlab-like environment with Scicos component which is Simulink equivalent. Syntax is really similar to Matlab, there are even some tools to convert programs between them. Very stable and mature environment, a lot of free toolboxes, very good and easy visualization and interface building (tk based). Scicos was also good, but its interface was quite not comfortable. I monitor this project periodically and I see that a lot changed since I used it last time and now it seems to be even better. But now I use LV for everthing...
-
Integration properties of 1/s come directly from defition of Laplace transform and mean that for any F(s), inverse transform of F(s)/s is equal to integral of f(t), where f(t) is inverse transform of F(s). It has nothing to inverse transform of 1/s itself. If you want to apply this rule to 1/(s+a) you have to extract 1/s from it: 1/(s+a)=(1/s)*(s/(s+a)). Inverse transform of s/(s+a) is -a*exp(-at), integral of which is exp(-at). Laplace transorm may help you to calculate integral of given function f(t). You simply has to calculate its transform L{f(t)}=F(s), divide it by s (multiply by 1/s) and make inverse transform of the result. It will be equal to integral of f(t).
-
Position a SubVI relative to a wire in a container
vugie replied to jcarmody's topic in VI Scripting
Here is version which properly (I hope) tests the data type. I used Compare Data Type (private) method of Application. There is also Compare Type method which compares type descriptors. I also added automatic calculation of proper offset to center the wire (for y coordinate). You could also think of calculating x coordinate from cursor position. Insert_AS2Q_vug.llb -
Position a SubVI relative to a wire in a container
vugie replied to jcarmody's topic in VI Scripting
The wire datatype is always a datatype of its source terminal, which is always first element of Terminals[] property of the wire. And Terminal has Data Type property (variant) and Type Descriptor property (which is not exposed in scripting, so you have to use Scripting Workbench or PMS Assistant to get it). What concerns not centered wire - I can't open your code (please save in 8.2) but I belive that you should use Create Described Wire method providing as wire description start and end points which should be center terminal points (see my previous post). Remember that coordinates should be provided in reversed form (y,x). Check out how I do it in my Weird Wires plugin. -
Position a SubVI relative to a wire in a container
vugie replied to jcarmody's topic in VI Scripting
I do nor understand exactly what do you search for, but this is what I know: - wire's owner is always a diagram (so this is why wire's owner's owner is case structure) - diagram is also positioned against its owner - I don't know exactly what wire's position means but I didn't find it useful - exact wiring point is TerminalPosition + (TerminalSize modulo 2) -
Scripting Workbench and PMS Assitstant are still useful nowdays...