Detecting intersecting SCNGeometries and returning it as an array - scenekit

I am trying to find a way to detect whether or not an SCNGeometry is intersecting with any other SCNGeometries. I can't seem to find anything in apple docs to support this notion, nor anything online either.
As of right now, the only method I can think of doing is enabling the Physics Engine and doing contact tests, but I want to try and avoid it if possible.
Basically, all I want to do is throw an SCNGeometry onto the a scene, and detect what SCNGeometry it is touching (Basically getting an array of geometries) so that I may process further steps.
There is no code as of yet, I am trying to research how if possible it can be done.
I can also accept code in any programming language, so feel free to provide an answer in what you feel most comfortable with.

Related

Drone SDK supporting free-flight control

This is my first time getting into drones.
I am looking at DJI drones, currently as it seems most promising from a documentation and reviews point of view.
Basically, I would like to program a drone(s) to fly a certain pattern and take pictures when a certain criteria is met. For example, I would like the drone to take off and fly around a small park, stopping to take a picture of each tree it encounters, automatically (auto-piloted / driven by some "AI").
Now I glanced thru the DJI SDK documentation, and so far it SEEMS this is possible (via FlightControl class). But im not sure.
Question:
Can my requirements be met with current drone SDK technologies?
Yes, the correct SDK, 4.11.1 will do everything you mentioned. You will need to do some location calculations but that's about it.
The sample will almost do everything you want as-is, with minor changes.
With the DJI Mobile SDK you can use the Mission classes to automatically fly a given set of coordinates (waypoints) and do some actions once you arrive at a waypoint, e.g. take a picture.
However the SDK has limitations:
The SDK is unable to detects objects in the video stream. Therefore it is needed to use your own code to detect objects yourself.
The way the drone flies to the waypoint is quite limited, e.g. the drone will always face the camera in the direction of flight.
When using the DJI Mission classes, a change of the route during execution is only possible with the use of timeline Missions by adding timeline elements to the list.
As you already assumed in the comment: Yes, the Mobile SDK is more advanced than Windows SDK.

How do I import a vector of data in Vensim P.L.E. 8.0.4. x64

I am a user of Vensim P.L.E. 8.0.4. x64. This is the Personal Learning Edition, that is freely available for 60 days.
I am trying to get familiar with it.
I tried to replicate some examples available online, such as these two:
first video
second video
and I was successful.
Now I would like to include in my simulations not only a scalar, but an array or a vector of numbers. This is because I would like to use a set of real world data I have for different municipalities and it would be of little informative to do it for each of them separately.
I followed the indications provided here:
Link for the use of the function tabbed array
which substantially provides what I would need. Yet, at the very same page I read "Availability: Professional and DSS only." I am thus inclined to think that this is not a function I can have access to.
I tried to specify an equation for one of my variables by making use of TABBED ARRAY, but I got the error message "Expecting an operator" in the relevant section of the window, as reported below.
I would be very grateful if anyone could help me to understand if the error is related to my sintax, or to the Versim version I am using or to other possible reasons.
I understood, but correct me if I am wrong, that there is a way to work with Vensim by coding but I am not sure this possibility is open to the version I am using.
I do thank you very much for your help.
Marco
I think that error message really comes from the version PLE you are using.
You also could try import the constants from Excel using the GET XLS DATA('file','tab','row or col','cell') function [1]. But this function don't work into PLE version too.
So I advise you use Insight Maker in the first steps of modelling, that is general-purpose simulation and modeling tool, open source and that run in your web browser [2]. On this platform you could import data manually using converters objects [3].
Below we see a print screen from the Insight Maker workspace with a converter object to data import.

Recreating KaTeX emulation in La/TeX?

I'm working on a site that is using KaTeX for rendering math. However, the interface for entering the math content is (really) not ideal, so it is actually faster for me to work in an editor, like Sublime Text 3 and import the work; however, an issue I run into is that when I import, I discover various functions / environments aren't supported (i.e. emulated) by KaTeX.
If it were just me working on the material, I would simply learn as I go and consult the KaTeX documentation page; however, I have several contractors working on digitizing content who do not have access to the site (and I don't have the ability to give them access), and so cannot learn by trial-and-error. Instead, I end up with piles of documents that all need to be manually adjusted, to render as desired with KaTeX.
As such, I wanted to assemble a preamble for a LaTeX document that would recreate the abilities (i.e. functions and environments) KaTeX can emulate, and was wondering if such a preamble / package already exists? I have tried a few quick searches, but because I'm looking for something that imitates an emulator, I'm finding it tricky to find the right choice of words to get relevant results.
I wasn't sure if this were best posted here or on the TeX.se - I suspect it falls in-between the two - so I apologize if my guess was wrong and I should've tried there first. Any suggestions would be very much appreciated, as this is creating a substantial bottle-neck in my workflow but is also just outside of my ability to solve on my own.
Supported functions is one thing. To tackle that you might actually stand a fair chance of just tokenizing the input, looking for backslash name sequences and checking them against a list extracted from KaTeX sources to see which are supported.
I guess one could even try to remove all other functions from LaTeX. Or rather hide them, such that the user input can't access them but third party libraries can. Getting rid of language features (as opposed to macros) such as \def would probably be even harder. Better askn on the TeX stack exchange for details of you really want to follow this route.
As an alternative I guess you might be able to perform the check I described above in TeX. Write a macro which reads the current file as plain text instead of TeX source, to perform this analysis. Or some such. But a separate stand-alone tool would be much easier.
If you are going for a separate tool, you might as well write it in JavaScript for Node, and have it run KaTeX on the input. That way you can at least tell whether it will get typeset to something or error out.
Whether the rendering is what you expect from LaTeX may be another question. In general KaTeX aims to reproduce LaTeX behaviour, so any difference might indicate a bug. But bugs exist, so all of this might not avoid the need for checks. How about you just processing the math part of the input with KaTeX to some HTML which authors can check without access to the site?
As for existing tools or macro packages, I know of none, but tool or library questions are off topic on stack exchange anyway.

Interpreting WinBUGS traps and how to automate the program?

First of all, does anybody know of a developer's guide for WinBUGS? The website is full of detailed examples for Doodles and documentation for the model language, but I have yet to find anything about how to interpret trap windows.
Secondly, has anybody found any ways to streamline the check/load/compile/init/monitor/update cycle? By that I mean, there doesn't seem to be any way to say "don't bother rechecking the model or putting any of the settings back to their defaults (!!!), just keep loading data from these files, inits from those files, and for each generate a new coda". Even the standard Windows shortcuts are neutered here, forcing the user to keep clicking and filling the same fields with the same values over and over. This might seem like a minor issue, but when you are doing many similar analyses one after the other, it gets old fast.
I'm at the point where I'm about to use TRON.EXE to send fake mouseclicks to the program, but before going to that extreme I'm hoping there is some native and more elegant way to automate repetitive WinBUGS tasks.
Well... that's WinBUGS at its normal :-) Unfriendly, showing traps that would scare of an experienced kernel hacker.. :-) I don't think there exist some guide to traps. I mean if WinBUGS creators wanted to put some effort in being more user friendly, they would probably first made the traps more understandable, so that no guide was necessary.
I was trying to do something similar - i.e. to customize WinBUGS behaviour. First, you can call WinBUGS from R using R2WinBUGS. That way you are able to do a lot automatization but not all. For example, I wanted to have something like progress information in WinBUGS. The problem is that WinBUGS UI gets stuck during update cycles. R2WinBUGS creates the script.txt command script and there is command update (<big number of cycles>). What I wanted here was to customize this script.txt to contain a lot of smaller update(..) commands instead of one big one. But, the problem is that R2WinBUGS generates this script itself and you cannot change it.
So the way to customize WinBUGS could be that you create your own wrapper that creates the script.txt and other files. I believe you could do a lot more customization to WinBUGS this way.
However, I'm not sure if WinBUGS is worth it. Its development has stopped and while favorited by many people, it remains rigid. You can try JAGS or CppBugs which seem to have much more promissing future.
For a wrapper around R2WinBUGS that adds lots of functionality to streamline serious WinBUGS use, see my package rube (http://www.stat.cmu.edu/~hseltman/rube/) which is not yet on CRAN.
Among other things, it gives plain English error messages rather than passing your model/data/inits along to WinBUGS when a trap error is certain. It also gives a highly useful summary of your model/data/inits for finding problems that cannot be automatically detected. Of course, it does not catch all trap errors.
Turns out I didn't RTFM enough on the second part of my question. It turns out that the section of the WinBUGS 1.4 manual entitled "Batch-Mode: Scripts" lists all the batch commands. All the important UI functionality has a batch-mode command. There was only a little trial-and-error in getting the arguments right (for example over.relax('true')). What really took me a while to sort out is that WinBUGS seems to have trouble with some Windows paths, but as long as everything is in a subdirectory of the directory where WinBUGS is installed, it runs okay.
It's still kind of messy to have to keep loading all these little files, but I wrote an R-script that uses functions from the BRugs package to create all the files, name them in a consistent pattern, and generate a script that will then initialize the model and load them, over and over again.
I'll leave this question open for a while, though, to see if anybody has any suggestions on where I can learn to make better use of traps.

Starting work on a Pre-existing Project

So this is more of a generic question. I seem to keep finding myself being put on larger and larger projects. Recently I have been assigned to a very large project written in C and VHDL. The goal is for me to become familiar with the code and eventually take the lead on the project. This is by far the largest project I have been assigned to work on that I didn't start.
So here is my question: What methods/tools do you use to learn how everything works?
Do you just increase and expand on comments?
Do you make a UML representation of the project?
Any tips would be great!
Thanks
If you can, sit down with the folks who are currently working on it and ask for a high-level solution overview to start and then go on your own from there, digging into the pieces one by one. Identify who is responsible for each functional area and follow up with them when you hit a rough spot.
Try and embed yourself with the team as quickly as possible, ask to sit in on code reviews and such. This will get you ramped up pretty quickly.
For VHDL I recommend using Sigasi. Sigasi is developped with this use case in mind. Sigasi makes it easy to navigate in new or legacy projects, which makes it feasible to understand how it is structured.
I find the UML almost useless. I find much more useful, real, static and dynamic call graphs. After I generate the call graph, I usually grok the source code through OpenGrok and cscope. See what calls what and what is called by whom for the most hot methods.

Resources