com.shinolab.autd3-sdk.pattern 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Pattern.cs
CHANGED
|
@@ -71,6 +71,44 @@ namespace AUTD3
|
|
|
71
71
|
new PatternOptionNative { Intensity = Intensity.Value, PhaseOffset = PhaseOffset.Value };
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
public readonly struct TwinTrapOption
|
|
75
|
+
{
|
|
76
|
+
public Intensity Intensity { get; }
|
|
77
|
+
public Phase PhaseOffset { get; }
|
|
78
|
+
|
|
79
|
+
public TwinTrapOption() : this(intensity: null)
|
|
80
|
+
{
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
public TwinTrapOption(Intensity? intensity = null, Phase? phaseOffset = null)
|
|
84
|
+
{
|
|
85
|
+
Intensity = intensity ?? Intensity.Max;
|
|
86
|
+
PhaseOffset = phaseOffset ?? Phase.Zero;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
internal PatternOptionNative ToNative() =>
|
|
90
|
+
new PatternOptionNative { Intensity = Intensity.Value, PhaseOffset = PhaseOffset.Value };
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
public readonly struct VortexOption
|
|
94
|
+
{
|
|
95
|
+
public Intensity Intensity { get; }
|
|
96
|
+
public Phase PhaseOffset { get; }
|
|
97
|
+
|
|
98
|
+
public VortexOption() : this(intensity: null)
|
|
99
|
+
{
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
public VortexOption(Intensity? intensity = null, Phase? phaseOffset = null)
|
|
103
|
+
{
|
|
104
|
+
Intensity = intensity ?? Intensity.Max;
|
|
105
|
+
PhaseOffset = phaseOffset ?? Phase.Zero;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
internal PatternOptionNative ToNative() =>
|
|
109
|
+
new PatternOptionNative { Intensity = Intensity.Value, PhaseOffset = PhaseOffset.Value };
|
|
110
|
+
}
|
|
111
|
+
|
|
74
112
|
[StructLayout(LayoutKind.Sequential)]
|
|
75
113
|
internal struct EmissionNative
|
|
76
114
|
{
|
|
@@ -147,6 +185,24 @@ namespace AUTD3
|
|
|
147
185
|
[DllImport(Lib, CallingConvention = CallingConvention.Cdecl)]
|
|
148
186
|
internal static extern int autd3_pattern_bessel_transducer(float[] position, float[] apex, float[] dir, float thetaRad, float wavelengthMm, in PatternOptionNative option, out EmissionNative @out);
|
|
149
187
|
|
|
188
|
+
[DllImport(Lib, CallingConvention = CallingConvention.Cdecl)]
|
|
189
|
+
internal static extern int autd3_pattern_twin_trap(GeometryHandle geometry, float[] target, float[] normal, float wavelengthMm, in PatternOptionNative option, PatternBufferHandle buffer);
|
|
190
|
+
|
|
191
|
+
[DllImport(Lib, CallingConvention = CallingConvention.Cdecl)]
|
|
192
|
+
internal static extern int autd3_pattern_twin_trap_device(GeometryHandle geometry, UIntPtr dev, float[] target, float[] normal, float wavelengthMm, in PatternOptionNative option, [Out] EmissionNative[] dst);
|
|
193
|
+
|
|
194
|
+
[DllImport(Lib, CallingConvention = CallingConvention.Cdecl)]
|
|
195
|
+
internal static extern int autd3_pattern_twin_trap_transducer(float[] position, float[] target, float[] normal, float wavelengthMm, in PatternOptionNative option, out EmissionNative @out);
|
|
196
|
+
|
|
197
|
+
[DllImport(Lib, CallingConvention = CallingConvention.Cdecl)]
|
|
198
|
+
internal static extern int autd3_pattern_vortex(GeometryHandle geometry, float[] target, float[] axis, int order, float wavelengthMm, in PatternOptionNative option, PatternBufferHandle buffer);
|
|
199
|
+
|
|
200
|
+
[DllImport(Lib, CallingConvention = CallingConvention.Cdecl)]
|
|
201
|
+
internal static extern int autd3_pattern_vortex_device(GeometryHandle geometry, UIntPtr dev, float[] target, float[] axis, int order, float wavelengthMm, in PatternOptionNative option, [Out] EmissionNative[] dst);
|
|
202
|
+
|
|
203
|
+
[DllImport(Lib, CallingConvention = CallingConvention.Cdecl)]
|
|
204
|
+
internal static extern int autd3_pattern_vortex_transducer(float[] position, float[] target, float[] axis, int order, float wavelengthMm, in PatternOptionNative option, out EmissionNative @out);
|
|
205
|
+
|
|
150
206
|
[DllImport(Lib, CallingConvention = CallingConvention.Cdecl)]
|
|
151
207
|
internal static extern int autd3_pattern_uniform(byte phase, byte intensity, PatternBufferHandle buffer);
|
|
152
208
|
|
|
@@ -435,6 +491,78 @@ namespace AUTD3
|
|
|
435
491
|
return new Emission(new Phase(e.Phase), new Intensity(e.Intensity));
|
|
436
492
|
}
|
|
437
493
|
|
|
494
|
+
public static void TwinTrap(Geometry geometry, Vector3 target, Vector3 normal, Length wavelength, TwinTrapOption option, PatternBuffer dst)
|
|
495
|
+
{
|
|
496
|
+
var t = Coords.PointArray(target);
|
|
497
|
+
var n = Coords.DirArray(normal);
|
|
498
|
+
var o = option.ToNative();
|
|
499
|
+
if (NativePattern.autd3_pattern_twin_trap(geometry.Handle, t, n, wavelength.Mm, in o, dst.Handle) != 0)
|
|
500
|
+
{
|
|
501
|
+
throw new Autd3Exception("twin_trap failed (buffer device count must match geometry)");
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
public static void TwinTrapDevice(Device device, Vector3 target, Vector3 normal, Length wavelength, TwinTrapOption option, Emission[] dst)
|
|
506
|
+
{
|
|
507
|
+
var native = ToNativeDst(dst);
|
|
508
|
+
var o = option.ToNative();
|
|
509
|
+
if (NativePattern.autd3_pattern_twin_trap_device(device.GeometryHandle, device.DeviceIndex,
|
|
510
|
+
Coords.PointArray(target), Coords.DirArray(normal), wavelength.Mm, in o, native) != 0)
|
|
511
|
+
{
|
|
512
|
+
throw new Autd3Exception("twin_trap_device failed");
|
|
513
|
+
}
|
|
514
|
+
FromNativeDst(native, dst);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
public static Emission TwinTrapTransducer(Vector3 position, Vector3 target, Vector3 normal, Length wavelength, TwinTrapOption option)
|
|
518
|
+
{
|
|
519
|
+
var o = option.ToNative();
|
|
520
|
+
if (NativePattern.autd3_pattern_twin_trap_transducer(
|
|
521
|
+
Coords.PointArray(position),
|
|
522
|
+
Coords.PointArray(target),
|
|
523
|
+
Coords.DirArray(normal), wavelength.Mm, in o, out var e) != 0)
|
|
524
|
+
{
|
|
525
|
+
throw new Autd3Exception("twin_trap_transducer failed");
|
|
526
|
+
}
|
|
527
|
+
return new Emission(new Phase(e.Phase), new Intensity(e.Intensity));
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
public static void Vortex(Geometry geometry, Vector3 target, Vector3 axis, int order, Length wavelength, VortexOption option, PatternBuffer dst)
|
|
531
|
+
{
|
|
532
|
+
var t = Coords.PointArray(target);
|
|
533
|
+
var a = Coords.DirArray(axis);
|
|
534
|
+
var o = option.ToNative();
|
|
535
|
+
if (NativePattern.autd3_pattern_vortex(geometry.Handle, t, a, order, wavelength.Mm, in o, dst.Handle) != 0)
|
|
536
|
+
{
|
|
537
|
+
throw new Autd3Exception("vortex failed (buffer device count must match geometry)");
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
public static void VortexDevice(Device device, Vector3 target, Vector3 axis, int order, Length wavelength, VortexOption option, Emission[] dst)
|
|
542
|
+
{
|
|
543
|
+
var native = ToNativeDst(dst);
|
|
544
|
+
var o = option.ToNative();
|
|
545
|
+
if (NativePattern.autd3_pattern_vortex_device(device.GeometryHandle, device.DeviceIndex,
|
|
546
|
+
Coords.PointArray(target), Coords.DirArray(axis), order, wavelength.Mm, in o, native) != 0)
|
|
547
|
+
{
|
|
548
|
+
throw new Autd3Exception("vortex_device failed");
|
|
549
|
+
}
|
|
550
|
+
FromNativeDst(native, dst);
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
public static Emission VortexTransducer(Vector3 position, Vector3 target, Vector3 axis, int order, Length wavelength, VortexOption option)
|
|
554
|
+
{
|
|
555
|
+
var o = option.ToNative();
|
|
556
|
+
if (NativePattern.autd3_pattern_vortex_transducer(
|
|
557
|
+
Coords.PointArray(position),
|
|
558
|
+
Coords.PointArray(target),
|
|
559
|
+
Coords.DirArray(axis), order, wavelength.Mm, in o, out var e) != 0)
|
|
560
|
+
{
|
|
561
|
+
throw new Autd3Exception("vortex_transducer failed");
|
|
562
|
+
}
|
|
563
|
+
return new Emission(new Phase(e.Phase), new Intensity(e.Intensity));
|
|
564
|
+
}
|
|
565
|
+
|
|
438
566
|
public static void Uniform(Emission emission, PatternBuffer dst)
|
|
439
567
|
{
|
|
440
568
|
if (NativePattern.autd3_pattern_uniform(emission.Phase.Value, emission.Intensity.Value, dst.Handle) != 0)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/THIRD-PARTY-LICENSES.md
CHANGED
|
@@ -854,8 +854,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
854
854
|
|
|
855
855
|
Used by:
|
|
856
856
|
|
|
857
|
-
- autd3-rs-core 0.
|
|
858
|
-
- autd3-rs-pattern 0.
|
|
857
|
+
- autd3-rs-core 0.8.0 — https://github.com/shinolab/autd3-sdk
|
|
858
|
+
- autd3-rs-pattern 0.8.0 — https://github.com/shinolab/autd3-sdk
|
|
859
859
|
- autd3-cpu-wire 0.6.0 — https://github.com/shinolab/autd3-sdk
|
|
860
860
|
|
|
861
861
|
```
|
|
@@ -887,8 +887,8 @@ SOFTWARE.
|
|
|
887
887
|
|
|
888
888
|
Used by:
|
|
889
889
|
|
|
890
|
-
- autd3-ffi-abi 0.
|
|
891
|
-
- autd3-ffi-pattern 0.
|
|
890
|
+
- autd3-ffi-abi 0.8.0 — https://github.com/shinolab/autd3-sdk
|
|
891
|
+
- autd3-ffi-pattern 0.8.0 — https://github.com/shinolab/autd3-sdk
|
|
892
892
|
- chrono 0.4.45 — https://github.com/chronotope/chrono
|
|
893
893
|
- wide 1.5.0 — https://github.com/Lokathor/wide
|
|
894
894
|
- winapi-i686-pc-windows-gnu 0.4.0 — https://github.com/retep998/winapi-rs
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"url": "git+https://github.com/shinolab/autd3-sdk.git",
|
|
6
6
|
"directory": "bindings/unity/com.shinolab.autd3-sdk.pattern"
|
|
7
7
|
},
|
|
8
|
-
"version": "0.
|
|
8
|
+
"version": "0.8.0",
|
|
9
9
|
"displayName": "AUTD3 Pattern",
|
|
10
10
|
"description": "AUTD3 emission patterns: Focus, Plane, Bessel (Unity binding).",
|
|
11
11
|
"unity": "6000.0",
|
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
"url": "https://github.com/shinolab"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"com.shinolab.autd3-sdk.core": "0.
|
|
18
|
+
"com.shinolab.autd3-sdk.core": "0.8.0"
|
|
19
19
|
}
|
|
20
20
|
}
|