How to change the default marker pattern size in JSARToolkit - artoolkit

According from this guide from ARToolkit, the default marker pattern size is 16x16. Is it possible to be able to modify it to 32x32 in JSARToolkit?

You would need to add the arPattCreateHandle2 function to the emscripten bindings https://github.com/artoolkitx/jsartoolkit5/blob/master/emscripten/ARBindEM.cpp
similar to, for example, this function https://github.com/artoolkitx/jsartoolkit5/blob/master/emscripten/ARBindEM.cpp#L67
And write a binding function for it in ARToolKitJS.cpp like here https://github.com/artoolkitx/jsartoolkit5/blob/master/emscripten/ARToolKitJS.cpp#L482
I think you also need to add it to the FUNCTIONS array (https://github.com/artoolkitx/jsartoolkit5/blob/master/js/artoolkit.api.js#L1578)
Then you need to rebuild the library using emscripten.
For rebuild I wrote the guide in the readme on artoolkitX (https://github.com/artoolkitx/jsartoolkit5) which is easiest to follow if you use the Docker root. Otherwise, you need to setup emscripten on your local machine.
If you already use emscripten locally you can simply do npm run build from the jsartoolkit root.
I'm actively maintaining the artoolkitX repo and I'm certain that it builds meaning you should clone from there.
Let me know how it goes.

Related

Is there a built in function to find the operating system?

So I want to navigate the file system from within a Fiji script, and create files. macOS uses / as a separator while windows uses \ as a file separator. I can't for the life of me find an easy way to do this given the poor search ability of the documentation.
For example, in Matlab, I can use a built it variable filesep or ispc() or ismac() to find out.
Is there a similar function in imageJ?
Thanks
I just found the answer. Using Fiji, you can use File.separator.
See further documentation here

Can Bazel aspects access the current target's java_common.provider

As part of our efforts to create a bazel-maven transition interop tool (that creates maven sized jars from more granular sized bazel jars),
we want the aspect that runs on bazel build to access the target's java_common.provider in order to fetch the jars and ijars from it.
Is that possible?
The short answer is yes, that's possible.
You can use the java_common module in an aspect implementation the same way you would use it in a rule implementation.
From the documentation on java_common.provider:
java_common.provider.compile_jars and java_common.provider.transitive_compile_time_jars refer to the ijars used at compilation time
java_common.provider.transitive_runtime_jars refer to the full jars used at runtime.
The full jars at compilation time are not yet available, but someone is working on exposing this feature. (Issue #3528 on GitHub.)
Make sure you also read the blog post on this topic: https://blog.bazel.build/2017/03/07/java-sandwich.html

How to use external library with love2d

I'm trying to use the luafun library with love2d.
Running lua main.lua, however love . complains about the missing fun library.
I have installed luafun with luarocks.
There's two options.
If you want to distribute whatever you're building, you almost certainly don't want users to install Lua, luarocks, etc. etc. - so the best way is to simply put any libraries into the folder that your game/program/… lives in. (If a library contains compiled things, you'll need to build per platform/OS and then you'll actually want a build process that spits out the various variants, but if it's all-Lua, there's no platform-specific stuff, so just copy it in.)
The other option (mostly for when you only need it to work on your machine) is to adjust package.path and then love will find things just fine. If you use LUA_INIT / LUA_PATH on your machine, Love ignores them but you can manually fetch & process them using os.getenv, dofile / load(code)() & friends. (As the very simplest special case of this, if luarocks is installed in the standard Lua search path, saying require "luarocks.loader" might be enough to get all luarocks-installed packages to work.)

FunScript: How to access TypeScript.Api<...>

I'm getting started with FunScript with a working example. Using Nuget to add the needed libraries, it works well.
In watching a 2013 video on channel9, they are making use of TypeScript.Api<...> to load types from typescript definition files.
I'm however unable to find this type provider anywhere.
Where is it located?
I realized that a good number of the type definitions have been compiled into libraries and available on nuget but I can't really use this since some of the code will be local typescript definition files.
The questions therefore are
Where is the TypeScript.Api<...> type provider?
If it is not available or the best way to use typescript definition, what other options exists.
As Thomas said, the type provider was removed mainly because it couldn't generate generic types, but the idea is to bring it back at some point.
For the moment, though not ideal, you can generate your own bindings following these steps.
Download or clone Funscript repository
git clone https://github.com/ZachBray/FunScript
Build the project
cd FunScript
build.cmd
This needs to be improved but for now you need to zip the .d.ts files you want to convert and then:
cd build\TypeScript
bin\FunScript.TypeScript.exe C:\Path\to\typedefinitions.zip
cd Output
Please note the first time you build the definitions it may take several minutes. Once it's done in the output folder you'll find the compiled .dll libraries with the bindings.
Also, while you're at it. It's better if you use the FunScript version you just build into build\main\bin, as it will probably be more updated than the nuget package.
Good luck and have fun(script)!
There were a bunch of changes in FunScript, so the TypeScript.Api<...> type provider is no longer the recommended way of calling JavaScript libraries from FunScript.
Instead, the bindings for JavaScript libraries are pre-generated and you can find them as packages on NuGet, if you search for the FunScript tag (NuGet search is not very good, so you may need to go through a number of pages to find the one you need...).
If you want to use a local TypeScript definition, then you'll need to run the command line tool to generate the bindings. The F# Atom plugin does this in the build script, so looking there is a good place to start. It has a local copy of various TypeScript bindings in the typings folder (together with the FunScript binaries needed to process them).
I liked the type provider approach much better, but sadly, type providers are somewhat restricted in what kind of types they can provide, so it wasn't all that powerful...

"DART_SDK" environment variable is officially removed?

I remember DART_SDK was necessary. but now I am not able to find any document about DART_SDK.
When do we need to set DART_SDK ? I think there's no need in normal cases.
Some scripts needed a way to find the SDK and for this usually this environment variable was used. But as far as I have seen most code went away from this way of finding the SDK directory (see for example http://dartbug.com/17349, http://dartbug.com/16994, http://dartbug.com/15019 (fixed), http://dartbug.com/10444)
It depends on the tools you're using.
For example, I made DartVS use this variable to locate the SDK for the Analzyer (I saw it was already being used, so decided to piggy-back on it!).
In the next version, we will automatically download and unzip the SDK if this variable isn't set (so it won't be needed); however support for it still remains so you're able to change/override the SDK being used (eg. if you want to use dev channel versions, or go back to an old version).
(If you keep your SDK in the same place, then there shouldn't be any maintenance in keeping this set/valid. The Chocolatey package keeps the path the same across upgrades to aid this :))
Yes. You are right. This variable becomes unofficial (undocumented).
Of course, this is possible determine from the Dart script the path to Dart SDK.
But for the new programmers, that want to locate the path to Dart SDK from the non-Dart scripts (eg. from the .bat files), this can be problematic because currently not exists official way to specify the path to installed Dart SDK.

Resources