Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JITX-5813/revert-esir-changes #436

Merged
merged 2 commits into from
Aug 23, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions utils/parts.stanza
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ public defstruct LandPatternCode :
pcb-layer-value: PCBLayerValue
layers: Tuple<PCBLayerCode>
geometries: Tuple<GeomCode>
model3ds: Tuple<Model3D>
model3ds: Tuple<Model3DCode>

public-when(TESTING) defn LandPatternCode (json: JObject) -> LandPatternCode :
LandPatternCode(
Expand All @@ -910,7 +910,7 @@ public-when(TESTING) defn LandPatternCode (json: JObject) -> LandPatternCode :
PCBLayerValue(json["pcb_layer_value"] as JObject),
map(PCBLayerCode, json["layers"] as Tuple<JObject>),
map(GeomCode, json["geometries"] as Tuple<JObject>),
map(Model3D, json["model3ds"] as Tuple<JObject>)
map(Model3DCode, json["model3ds"] as Tuple<JObject>)
)

;Represents a via, copper, or pour.
Expand Down Expand Up @@ -967,11 +967,18 @@ defn ViaType (s: String) -> ViaType :
"MicroVia": MicroVia
"BlindVia": BlindVia

defn Model3D (json: JObject) -> Model3D :
Model3D(json["filename"] as String,
Vec3D(json["position"] as JObject),
Vec3D(json["scale"] as JObject),
Vec3D(json["rotation"] as JObject))
public defstruct Model3DCode :
model3d: Model3D
model3d-id: String

public defn Model3DCode (json: JObject) -> Model3DCode :
Model3DCode(
Model3D(json["filename"] as String,
Vec3D(json["position"] as JObject),
Vec3D(json["scale"] as JObject),
Vec3D(json["rotation"] as JObject))
json["jitx_model_3d_id"] as String
)

defn Vec3D (json: JObject) -> Vec3D :
Vec3D(json["x"] as Double,
Expand Down Expand Up @@ -1003,7 +1010,7 @@ defn to-jitx (lp: LandPatternCode, jitx-pads-by-pcb-pad-name: HashTable<String,

do(to-jitx, layers(lp))
do(to-jitx, geometries(lp))
do(to-jitx, model3ds(lp))
do(to-jitx{model3d(_)}, model3ds(lp))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually added function composition to lang-utils 4 months ago to allow for do(to-jitx * model3d, model3ds(lp))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You got me


my-landpattern

Expand Down
Loading