com.shinolab.autd3-sdk.core 0.2.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/AUTD3.Core.asmdef +14 -0
- package/AUTD3.Core.asmdef.meta +7 -0
- package/AssemblyInfo.cs +14 -0
- package/AssemblyInfo.cs.meta +11 -0
- package/Command.cs +11 -0
- package/Command.cs.meta +11 -0
- package/Config.cs +57 -0
- package/Config.cs.meta +11 -0
- package/Coords.cs +58 -0
- package/Coords.cs.meta +11 -0
- package/Geometry.cs +167 -0
- package/Geometry.cs.meta +11 -0
- package/GlobalUsings.cs +7 -0
- package/GlobalUsings.cs.meta +11 -0
- package/LICENSE.md +21 -0
- package/LICENSE.md.meta +7 -0
- package/MonoPInvokeCallbackAttribute.cs +15 -0
- package/MonoPInvokeCallbackAttribute.cs.meta +11 -0
- package/Native.cs +108 -0
- package/Native.cs.meta +11 -0
- package/Plugins/linux-x64/libautd3_core.so +0 -0
- package/Plugins/linux-x64/libautd3_core.so.meta +35 -0
- package/Plugins/linux-x64.meta +8 -0
- package/Plugins/osx-arm64/libautd3_core.dylib +0 -0
- package/Plugins/osx-arm64/libautd3_core.dylib.meta +35 -0
- package/Plugins/osx-arm64.meta +8 -0
- package/Plugins/win-x64/autd3_core.dll +0 -0
- package/Plugins/win-x64/autd3_core.dll.meta +35 -0
- package/Plugins/win-x64.meta +8 -0
- package/Plugins.meta +8 -0
- package/README.md +41 -0
- package/README.md.meta +7 -0
- package/SamplingConfig.cs +134 -0
- package/SamplingConfig.cs.meta +11 -0
- package/THIRD-PARTY-LICENSES.md +834 -0
- package/THIRD-PARTY-LICENSES.md.meta +7 -0
- package/Types.cs +251 -0
- package/Types.cs.meta +11 -0
- package/Units.cs +184 -0
- package/Units.cs.meta +11 -0
- package/csc.rsp +2 -0
- package/csc.rsp.meta +7 -0
- package/package.json +13 -0
- package/package.json.meta +7 -0
package/Types.cs
ADDED
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Numerics;
|
|
3
|
+
|
|
4
|
+
namespace AUTD3
|
|
5
|
+
{
|
|
6
|
+
public sealed class Autd3Exception : Exception
|
|
7
|
+
{
|
|
8
|
+
public Autd3Exception(string message) : base(message)
|
|
9
|
+
{
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
public readonly struct Autd3
|
|
15
|
+
{
|
|
16
|
+
public const int NumTransducers = 249;
|
|
17
|
+
public const uint GridX = 18;
|
|
18
|
+
public const uint GridY = 14;
|
|
19
|
+
public const float PitchMm = 10.16f;
|
|
20
|
+
public const float DeviceWidth = 192.0f;
|
|
21
|
+
public const float DeviceHeight = 151.4f;
|
|
22
|
+
|
|
23
|
+
public Vector3 Origin { get; }
|
|
24
|
+
public Quaternion Rotation { get; }
|
|
25
|
+
|
|
26
|
+
public Autd3(Vector3 origin) : this(origin, Coords.IdentityRotation)
|
|
27
|
+
{
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
public Autd3(Vector3 origin, Quaternion rotation)
|
|
31
|
+
{
|
|
32
|
+
Origin = origin;
|
|
33
|
+
Rotation = rotation;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
internal NativeCore.Autd3Device ToNative()
|
|
37
|
+
{
|
|
38
|
+
var o = Coords.Point(Origin);
|
|
39
|
+
var r = Coords.Rotation(Rotation);
|
|
40
|
+
return new NativeCore.Autd3Device
|
|
41
|
+
{
|
|
42
|
+
Ox = o.X,
|
|
43
|
+
Oy = o.Y,
|
|
44
|
+
Oz = o.Z,
|
|
45
|
+
Rw = r.W,
|
|
46
|
+
Rx = r.X,
|
|
47
|
+
Ry = r.Y,
|
|
48
|
+
Rz = r.Z,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public readonly struct Intensity
|
|
54
|
+
{
|
|
55
|
+
public byte Value { get; }
|
|
56
|
+
|
|
57
|
+
public Intensity(byte value)
|
|
58
|
+
{
|
|
59
|
+
Value = value;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
public static Intensity Max => new Intensity(0xFF);
|
|
63
|
+
public static Intensity Min => new Intensity(0x00);
|
|
64
|
+
|
|
65
|
+
public static Intensity operator +(Intensity lhs, Intensity rhs) =>
|
|
66
|
+
new Intensity((byte)Math.Min(lhs.Value + rhs.Value, 0xFF));
|
|
67
|
+
|
|
68
|
+
public static Intensity operator -(Intensity lhs, Intensity rhs) =>
|
|
69
|
+
new Intensity((byte)Math.Max(lhs.Value - rhs.Value, 0x00));
|
|
70
|
+
|
|
71
|
+
public static Intensity operator *(Intensity lhs, byte rhs) =>
|
|
72
|
+
new Intensity((byte)Math.Min(lhs.Value * rhs, 0xFF));
|
|
73
|
+
|
|
74
|
+
public static Intensity operator *(byte lhs, Intensity rhs) => rhs * lhs;
|
|
75
|
+
|
|
76
|
+
public static Intensity operator /(Intensity lhs, byte rhs) =>
|
|
77
|
+
new Intensity((byte)(lhs.Value / rhs));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
public readonly struct Phase
|
|
81
|
+
{
|
|
82
|
+
public byte Value { get; }
|
|
83
|
+
|
|
84
|
+
public Phase(byte value)
|
|
85
|
+
{
|
|
86
|
+
Value = value;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
public static Phase Zero => new Phase(0x00);
|
|
90
|
+
public static Phase Pi => new Phase(0x80);
|
|
91
|
+
|
|
92
|
+
public float Radian() => NativeCore.autd3_core_phase_radian(Value);
|
|
93
|
+
|
|
94
|
+
public static explicit operator Phase(Angle angle)
|
|
95
|
+
{
|
|
96
|
+
var p = (int)MathF.Round(angle.Radian / (2f * MathF.PI) * 256f);
|
|
97
|
+
return new Phase((byte)(p & 0xFF));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
public static explicit operator Phase(Complex value) =>
|
|
101
|
+
(Phase)new Angle(MathF.Atan2((float)value.Imaginary, (float)value.Real));
|
|
102
|
+
|
|
103
|
+
public static Phase operator +(Phase lhs, Phase rhs) =>
|
|
104
|
+
new Phase(unchecked((byte)(lhs.Value + rhs.Value)));
|
|
105
|
+
|
|
106
|
+
public static Phase operator -(Phase lhs, Phase rhs) =>
|
|
107
|
+
new Phase(unchecked((byte)(lhs.Value - rhs.Value)));
|
|
108
|
+
|
|
109
|
+
public static Phase operator *(Phase lhs, byte rhs) =>
|
|
110
|
+
new Phase(unchecked((byte)(lhs.Value * rhs)));
|
|
111
|
+
|
|
112
|
+
public static Phase operator *(byte lhs, Phase rhs) => rhs * lhs;
|
|
113
|
+
|
|
114
|
+
public static Phase operator /(Phase lhs, byte rhs) =>
|
|
115
|
+
new Phase((byte)(lhs.Value / rhs));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
public readonly struct Emission
|
|
119
|
+
{
|
|
120
|
+
public Phase Phase { get; }
|
|
121
|
+
public Intensity Intensity { get; }
|
|
122
|
+
|
|
123
|
+
public Emission(Phase phase, Intensity intensity)
|
|
124
|
+
{
|
|
125
|
+
Phase = phase;
|
|
126
|
+
Intensity = intensity;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
public static Emission Null => new Emission(Phase.Zero, Intensity.Min);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
public readonly struct Interface
|
|
133
|
+
{
|
|
134
|
+
private readonly string? _name;
|
|
135
|
+
|
|
136
|
+
private Interface(string? name)
|
|
137
|
+
{
|
|
138
|
+
_name = name;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
public static Interface Auto => default;
|
|
142
|
+
|
|
143
|
+
public static Interface Name(string name) => new Interface(name);
|
|
144
|
+
|
|
145
|
+
internal string? NameValue => _name;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
public readonly struct DeviceState : IEquatable<DeviceState>
|
|
149
|
+
{
|
|
150
|
+
private readonly byte _kind;
|
|
151
|
+
private readonly byte _bits;
|
|
152
|
+
|
|
153
|
+
private DeviceState(byte kind, byte bits)
|
|
154
|
+
{
|
|
155
|
+
_kind = kind;
|
|
156
|
+
_bits = bits;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
public static DeviceState Op => new DeviceState(0, 0);
|
|
160
|
+
public static DeviceState SafeOp => new DeviceState(1, 0);
|
|
161
|
+
public static DeviceState SafeOpError => new DeviceState(2, 0);
|
|
162
|
+
public static DeviceState Lost => new DeviceState(3, 0);
|
|
163
|
+
public static DeviceState Other(byte bits) => new DeviceState(4, bits);
|
|
164
|
+
|
|
165
|
+
internal static DeviceState FromNative(byte kind, byte bits) => new DeviceState(kind, bits);
|
|
166
|
+
|
|
167
|
+
public override string ToString() => _kind switch
|
|
168
|
+
{
|
|
169
|
+
0 => "OP",
|
|
170
|
+
1 => "SAFE-OP",
|
|
171
|
+
2 => "SAFE-OP + ERROR",
|
|
172
|
+
3 => "LOST",
|
|
173
|
+
_ => _bits switch
|
|
174
|
+
{
|
|
175
|
+
0x00 => "NONE",
|
|
176
|
+
0x01 => "INIT",
|
|
177
|
+
0x02 => "PRE-OP",
|
|
178
|
+
0x03 => "BOOT",
|
|
179
|
+
_ => $"UNKNOWN (0x{_bits:x2})",
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
public bool Equals(DeviceState other) => _kind == other._kind && _bits == other._bits;
|
|
184
|
+
|
|
185
|
+
public override bool Equals(object? obj) => obj is DeviceState other && Equals(other);
|
|
186
|
+
|
|
187
|
+
public override int GetHashCode() => (_kind << 8) | _bits;
|
|
188
|
+
|
|
189
|
+
public static bool operator ==(DeviceState left, DeviceState right) => left.Equals(right);
|
|
190
|
+
|
|
191
|
+
public static bool operator !=(DeviceState left, DeviceState right) => !left.Equals(right);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
public readonly struct DcSysTime : IEquatable<DcSysTime>, IComparable<DcSysTime>
|
|
195
|
+
{
|
|
196
|
+
private static readonly DateTime EcatEpoch = new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
|
197
|
+
|
|
198
|
+
private readonly ulong _ns;
|
|
199
|
+
|
|
200
|
+
private DcSysTime(ulong ns)
|
|
201
|
+
{
|
|
202
|
+
_ns = ns;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
public static DcSysTime Zero => new DcSysTime(0);
|
|
206
|
+
|
|
207
|
+
public static DcSysTime FromNanos(ulong ns) => new DcSysTime(ns);
|
|
208
|
+
|
|
209
|
+
public ulong SysTime => _ns;
|
|
210
|
+
|
|
211
|
+
public static DcSysTime Now() => FromUtc(DateTime.UtcNow);
|
|
212
|
+
|
|
213
|
+
public static DcSysTime FromUtc(DateTime utc)
|
|
214
|
+
{
|
|
215
|
+
var ticks = utc.ToUniversalTime().Ticks - EcatEpoch.Ticks;
|
|
216
|
+
if (ticks < 0)
|
|
217
|
+
{
|
|
218
|
+
throw new Autd3Exception("UTC time is out of the representable DcSysTime range (2000-01-01 0:00:00 UTC ..)");
|
|
219
|
+
}
|
|
220
|
+
return new DcSysTime((ulong)ticks * 100);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
public DateTime ToUtc() => EcatEpoch.AddTicks((long)(_ns / 100));
|
|
224
|
+
|
|
225
|
+
public static DcSysTime operator +(DcSysTime lhs, TimeSpan rhs) =>
|
|
226
|
+
new DcSysTime(checked(lhs._ns + (ulong)rhs.Ticks * 100));
|
|
227
|
+
|
|
228
|
+
public static DcSysTime operator -(DcSysTime lhs, TimeSpan rhs) =>
|
|
229
|
+
new DcSysTime(checked(lhs._ns - (ulong)rhs.Ticks * 100));
|
|
230
|
+
|
|
231
|
+
public bool Equals(DcSysTime other) => _ns == other._ns;
|
|
232
|
+
|
|
233
|
+
public override bool Equals(object? obj) => obj is DcSysTime other && Equals(other);
|
|
234
|
+
|
|
235
|
+
public override int GetHashCode() => _ns.GetHashCode();
|
|
236
|
+
|
|
237
|
+
public int CompareTo(DcSysTime other) => _ns.CompareTo(other._ns);
|
|
238
|
+
|
|
239
|
+
public static bool operator ==(DcSysTime left, DcSysTime right) => left.Equals(right);
|
|
240
|
+
|
|
241
|
+
public static bool operator !=(DcSysTime left, DcSysTime right) => !left.Equals(right);
|
|
242
|
+
|
|
243
|
+
public static bool operator <(DcSysTime left, DcSysTime right) => left._ns < right._ns;
|
|
244
|
+
|
|
245
|
+
public static bool operator >(DcSysTime left, DcSysTime right) => left._ns > right._ns;
|
|
246
|
+
|
|
247
|
+
public static bool operator <=(DcSysTime left, DcSysTime right) => left._ns <= right._ns;
|
|
248
|
+
|
|
249
|
+
public static bool operator >=(DcSysTime left, DcSysTime right) => left._ns >= right._ns;
|
|
250
|
+
}
|
|
251
|
+
}
|
package/Types.cs.meta
ADDED
package/Units.cs
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
|
|
3
|
+
namespace AUTD3
|
|
4
|
+
{
|
|
5
|
+
public readonly struct Length
|
|
6
|
+
{
|
|
7
|
+
public float Mm { get; }
|
|
8
|
+
|
|
9
|
+
internal Length(float mm)
|
|
10
|
+
{
|
|
11
|
+
Mm = mm;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public float M => Mm / 1000f;
|
|
15
|
+
|
|
16
|
+
public static Length Millimeters(float mm) => new Length(mm);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public readonly struct Angle
|
|
20
|
+
{
|
|
21
|
+
public float Radian { get; }
|
|
22
|
+
|
|
23
|
+
internal Angle(float radian)
|
|
24
|
+
{
|
|
25
|
+
Radian = radian;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public float Degree => Radian * (180f / MathF.PI);
|
|
29
|
+
|
|
30
|
+
public static Angle Zero => new Angle(0f);
|
|
31
|
+
|
|
32
|
+
public static Angle Pi => new Angle(MathF.PI);
|
|
33
|
+
|
|
34
|
+
public static Angle FromRadian(float radian) => new Angle(radian);
|
|
35
|
+
|
|
36
|
+
public static Angle FromDegree(float degree) => new Angle(degree * (MathF.PI / 180f));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public readonly struct Velocity
|
|
40
|
+
{
|
|
41
|
+
public float MmPerS { get; }
|
|
42
|
+
|
|
43
|
+
internal Velocity(float mmPerS)
|
|
44
|
+
{
|
|
45
|
+
MmPerS = mmPerS;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public float MPerS => MmPerS / 1000f;
|
|
49
|
+
|
|
50
|
+
public static Velocity FromMmS(float mmPerS) => new Velocity(mmPerS);
|
|
51
|
+
|
|
52
|
+
public static Velocity FromMS(float mPerS) => new Velocity(mPerS * 1000f);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
public readonly struct Freq
|
|
56
|
+
{
|
|
57
|
+
internal enum FreqMode : byte
|
|
58
|
+
{
|
|
59
|
+
FloatExact = 0,
|
|
60
|
+
IntExact = 1,
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
internal FreqMode Mode { get; }
|
|
64
|
+
internal float HzValue { get; }
|
|
65
|
+
internal uint HzIntValue { get; }
|
|
66
|
+
|
|
67
|
+
internal Freq(FreqMode mode, float hz, uint hzInt)
|
|
68
|
+
{
|
|
69
|
+
Mode = mode;
|
|
70
|
+
HzValue = hz;
|
|
71
|
+
HzIntValue = hzInt;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public float Hz => HzValue;
|
|
75
|
+
|
|
76
|
+
internal byte ModeCode => (byte)Mode;
|
|
77
|
+
|
|
78
|
+
public static Freq operator +(Freq lhs, Freq rhs) =>
|
|
79
|
+
lhs.Mode == FreqMode.IntExact && rhs.Mode == FreqMode.IntExact
|
|
80
|
+
? new Freq(FreqMode.IntExact, lhs.HzValue + rhs.HzValue, lhs.HzIntValue + rhs.HzIntValue)
|
|
81
|
+
: new Freq(FreqMode.FloatExact, lhs.HzValue + rhs.HzValue, 0);
|
|
82
|
+
|
|
83
|
+
public static Freq operator -(Freq lhs, Freq rhs) =>
|
|
84
|
+
lhs.Mode == FreqMode.IntExact && rhs.Mode == FreqMode.IntExact
|
|
85
|
+
? new Freq(FreqMode.IntExact, lhs.HzValue - rhs.HzValue, lhs.HzIntValue - rhs.HzIntValue)
|
|
86
|
+
: new Freq(FreqMode.FloatExact, lhs.HzValue - rhs.HzValue, 0);
|
|
87
|
+
|
|
88
|
+
public static Freq operator *(Freq lhs, uint rhs) =>
|
|
89
|
+
lhs.Mode == FreqMode.IntExact
|
|
90
|
+
? new Freq(FreqMode.IntExact, lhs.HzValue * rhs, lhs.HzIntValue * rhs)
|
|
91
|
+
: new Freq(FreqMode.FloatExact, lhs.HzValue * rhs, 0);
|
|
92
|
+
|
|
93
|
+
public static Freq operator *(Freq lhs, float rhs) =>
|
|
94
|
+
new Freq(FreqMode.FloatExact, lhs.HzValue * rhs, 0);
|
|
95
|
+
|
|
96
|
+
public static Freq operator /(Freq lhs, uint rhs) =>
|
|
97
|
+
lhs.Mode == FreqMode.IntExact
|
|
98
|
+
? new Freq(FreqMode.IntExact, lhs.HzIntValue / rhs, lhs.HzIntValue / rhs)
|
|
99
|
+
: new Freq(FreqMode.FloatExact, lhs.HzValue / rhs, 0);
|
|
100
|
+
|
|
101
|
+
public static Freq operator /(Freq lhs, float rhs) =>
|
|
102
|
+
new Freq(FreqMode.FloatExact, lhs.HzValue / rhs, 0);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
public readonly struct Nearest<T>
|
|
106
|
+
{
|
|
107
|
+
public T Value { get; }
|
|
108
|
+
|
|
109
|
+
public Nearest(T value)
|
|
110
|
+
{
|
|
111
|
+
Value = value;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
public readonly struct LengthUnit
|
|
116
|
+
{
|
|
117
|
+
internal float MmPerUnit { get; }
|
|
118
|
+
|
|
119
|
+
internal LengthUnit(float mmPerUnit)
|
|
120
|
+
{
|
|
121
|
+
MmPerUnit = mmPerUnit;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
public static Length operator *(float value, LengthUnit unit) => new Length(value * unit.MmPerUnit);
|
|
125
|
+
|
|
126
|
+
public static Length operator *(int value, LengthUnit unit) => new Length(value * unit.MmPerUnit);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
public readonly struct AngleUnit
|
|
130
|
+
{
|
|
131
|
+
internal float RadPerUnit { get; }
|
|
132
|
+
|
|
133
|
+
internal AngleUnit(float radPerUnit)
|
|
134
|
+
{
|
|
135
|
+
RadPerUnit = radPerUnit;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
public static Angle operator *(float value, AngleUnit unit) => new Angle(value * unit.RadPerUnit);
|
|
139
|
+
|
|
140
|
+
public static Angle operator *(int value, AngleUnit unit) => new Angle(value * unit.RadPerUnit);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
public readonly struct FreqUnit
|
|
144
|
+
{
|
|
145
|
+
internal float HzPerUnit { get; }
|
|
146
|
+
internal uint HzPerUnitInt { get; }
|
|
147
|
+
|
|
148
|
+
internal FreqUnit(float hzPerUnit, uint hzPerUnitInt)
|
|
149
|
+
{
|
|
150
|
+
HzPerUnit = hzPerUnit;
|
|
151
|
+
HzPerUnitInt = hzPerUnitInt;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
public static Freq operator *(int value, FreqUnit unit) =>
|
|
155
|
+
new Freq(Freq.FreqMode.IntExact, value * unit.HzPerUnit, (uint)value * unit.HzPerUnitInt);
|
|
156
|
+
|
|
157
|
+
public static Freq operator *(float value, FreqUnit unit) =>
|
|
158
|
+
new Freq(Freq.FreqMode.FloatExact, value * unit.HzPerUnit, 0);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
public readonly struct SecUnit
|
|
162
|
+
{
|
|
163
|
+
public static Velocity operator /(Length length, SecUnit unit)
|
|
164
|
+
{
|
|
165
|
+
_ = unit;
|
|
166
|
+
return new Velocity(length.Mm);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
public static class Units
|
|
171
|
+
{
|
|
172
|
+
public static readonly LengthUnit m = new LengthUnit(1000f);
|
|
173
|
+
public static readonly LengthUnit mm = new LengthUnit(1f);
|
|
174
|
+
public static readonly AngleUnit rad = new AngleUnit(1f);
|
|
175
|
+
public static readonly AngleUnit deg = new AngleUnit((float)(Math.PI / 180.0));
|
|
176
|
+
public static readonly FreqUnit Hz = new FreqUnit(1f, 1u);
|
|
177
|
+
public static readonly FreqUnit kHz = new FreqUnit(1000f, 1000u);
|
|
178
|
+
public static readonly SecUnit s = default;
|
|
179
|
+
|
|
180
|
+
public static Nearest<Freq> Nearest(Freq freq) => new Nearest<Freq>(freq);
|
|
181
|
+
|
|
182
|
+
public static Nearest<TimeSpan> Nearest(TimeSpan period) => new Nearest<TimeSpan>(period);
|
|
183
|
+
}
|
|
184
|
+
}
|
package/Units.cs.meta
ADDED
package/csc.rsp
ADDED
package/csc.rsp.meta
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "com.shinolab.autd3-sdk.core",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"displayName": "AUTD3 Core",
|
|
5
|
+
"description": "AUTD3 core types, geometry and units (Unity binding).",
|
|
6
|
+
"unity": "6000.0",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Shun Suzuki",
|
|
10
|
+
"url": "https://github.com/shinolab"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {}
|
|
13
|
+
}
|