Skip to content

Commit

Permalink
feat: ParticleSystemModel
Browse files Browse the repository at this point in the history
  • Loading branch information
dbirman committed Apr 4, 2024
1 parent 9c4d0c6 commit 74b1441
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
16 changes: 6 additions & 10 deletions models/csharp/UrchinModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,26 +182,22 @@ public MeshModel(string id, string shape, Vector3 position, Color color, Vector3


[Serializable]
public struct ParticleGroupModel
public struct ParticleSystemModel
{
public string ID;
public Vector3 Scale;
public string Shape;
public string Material;
public float[] Xs;
public float[] Ys;
public float[] Zs;
public Vector3[] Positions;
public float[] Sizes;
public Color[] Colors;

public ParticleGroupModel(string id, Vector3 scale, string shape, string material, float[] xs, float[] ys, float[] zs, Color[] colors)
public ParticleSystemModel(string id, string shape, string material, Vector3[] positions, float[] sizes, Color[] colors)
{
ID = id;
Scale = scale;
Shape = shape;
Material = material;
Xs = xs;
Ys = ys;
Zs = zs;
Positions = positions;
Sizes = sizes;
Colors = colors;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"$defs": {"Color": {"properties": {"r": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "R", "type": "number"}, "g": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "G", "type": "number"}, "b": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "B", "type": "number"}, "a": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "A", "type": "number"}}, "title": "Color", "type": "object"}, "Vector3": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}, "z": {"default": 0.0, "title": "Z", "type": "number"}}, "title": "Vector3", "type": "object"}}, "properties": {"ID": {"title": "Id", "type": "string"}, "Scale": {"$ref": "#/$defs/Vector3"}, "Shape": {"title": "Shape", "type": "string"}, "Material": {"title": "Material", "type": "string"}, "Xs": {"items": {"type": "number"}, "title": "Xs", "type": "array"}, "Ys": {"items": {"type": "number"}, "title": "Ys", "type": "array"}, "Zs": {"items": {"type": "number"}, "title": "Zs", "type": "array"}, "Colors": {"items": {"$ref": "#/$defs/Color"}, "title": "Colors", "type": "array"}}, "required": ["ID", "Scale", "Shape", "Material", "Xs", "Ys", "Zs", "Colors"], "title": "ParticleGroupModel", "type": "object"}
{"$defs": {"Color": {"properties": {"r": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "R", "type": "number"}, "g": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "G", "type": "number"}, "b": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "B", "type": "number"}, "a": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "A", "type": "number"}}, "title": "Color", "type": "object"}, "Vector3": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}, "z": {"default": 0.0, "title": "Z", "type": "number"}}, "title": "Vector3", "type": "object"}}, "properties": {"ID": {"title": "Id", "type": "string"}, "Shape": {"title": "Shape", "type": "string"}, "Material": {"title": "Material", "type": "string"}, "Positions": {"items": {"$ref": "#/$defs/Vector3"}, "title": "Positions", "type": "array"}, "Sizes": {"items": {"type": "number"}, "title": "Sizes", "type": "array"}, "Colors": {"items": {"$ref": "#/$defs/Color"}, "title": "Colors", "type": "array"}}, "required": ["ID", "Shape", "Material", "Positions", "Sizes", "Colors"], "title": "ParticleSystemModel", "type": "object"}
15 changes: 6 additions & 9 deletions src/vbl_aquarium/models/urchin.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,14 @@ class ProbeModel(VBLBaseModel):
# Particle group


class ParticleGroupModel(VBLBaseModel):
class ParticleSystemModel(VBLBaseModel):
id: str = Field(alias="ID")
scale: Vector3
shape: str
material: str
n: int
material: str = 'circle'

xs: list[float]
ys: list[float]
zs: list[float]

colors: list[Color]
positions: list[Vector3] = []
sizes: list[float] = []
colors: list[Color] = []

# Text

Expand Down

0 comments on commit 74b1441

Please sign in to comment.