@typegpu/geometry Improve line rendering APIs#2470
Conversation
88e23e0 to
1b5ba58
Compare
| label: getName(this) ?? '<unnamed>', | ||
| format: props.format, | ||
| size: props.size, | ||
| size: [...props.size], |
There was a problem hiding this comment.
I was getting some type issues in my strict codebase, not sure if you want to fix it upstream.
There was a problem hiding this comment.
Are these errors brought up by a linter, or by the type checker? 👀
There was a problem hiding this comment.
I was installing the library by doing file:.. installation from local disk to test the implementation, and I don't know why, but typescript started type checking the dependency and found this to be an issue. Not sure how strict typegpu project ts is, but I had strict and noUncheckedIndexedAccess.
Here specifically, it complained that props.size is readonly and can't be assigned to size: number[] which is mutable. Makes sense, but that's also why I don't use readonly haha. You really need to splatter it everywhere.
|
|
||
| functionDefinition(options: FunctionDefinitionOptions): string; | ||
| typeInstantiation(schema: BaseData, args: readonly Snippet[]): ResolvedSnippet; | ||
| typeInstantiation(schema: BaseData, args: readonly (Snippet | undefined)[]): ResolvedSnippet; |
63cb621 to
ebbd856
Compare
ebbd856 to
ad3ef31
Compare
Renamed and reordered the APIs a bit, and allow customization of arrow caps.
lineSegmentVariableWidth(vertexIndex, A, B, C, D, MAX_JOIN_COUNT)->polylineVariableWidth(A, B, C, D, vertexIndex, MAX_JOIN_COUNT)lineVariableWidth(A, B, vertexIndex, MAX_JOIN_COUNT)With new
arrowCapParamsSlot, one can change arrow cap shape (length, width, slant).