forked from KhronosGroup/glTF
-
Notifications
You must be signed in to change notification settings - Fork 9
BENTLEY_materials_line_style #89
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
339604b
draft wip
markschlosseratbentley ab1e2b6
update README & schema
danielzhong 546eb74
Update README.md
danielzhong 915a7b0
Update README.md
danielzhong 1fbbb15
rename
danielzhong dd40552
Update material.BENTLEY_material_line_style.schema.json
danielzhong b93d51d
Update extensions/2.0/Vendor/BENTLEY_material_line_style/README.md
danielzhong 17f8c12
Update extensions/2.0/Vendor/BENTLEY_material_line_style/README.md
danielzhong d1cbb59
Update extensions/2.0/Vendor/BENTLEY_material_line_style/README.md
danielzhong f82a869
Update extensions/2.0/Vendor/BENTLEY_material_line_style/README.md
danielzhong 32923b7
Update README.md
danielzhong 00ad2d4
copyright
markschlosseratbentley 14bea10
contributor list
markschlosseratbentley 2b3fc30
Update material.BENTLEY_material_line_style.schema.json
danielzhong 0ec3508
materials plural
markschlosseratbentley 98d282c
materials plural
markschlosseratbentley 535c58b
plural
markschlosseratbentley e3db76e
update
danielzhong 2c4af97
Update README.md
danielzhong 7b35020
Update extensions/2.0/Vendor/BENTLEY_materials_line_style/README.md
danielzhong 5bcbd1d
Update extensions/2.0/Vendor/BENTLEY_materials_line_style/README.md
danielzhong 35e0630
Update extensions/2.0/Vendor/BENTLEY_materials_line_style/README.md
danielzhong 4c4c1c4
Update extensions/2.0/Vendor/BENTLEY_materials_line_style/README.md
danielzhong 384fe75
Update extensions/2.0/Vendor/BENTLEY_materials_line_style/README.md
danielzhong c6a75f2
Update README.md
danielzhong 10ada04
Merge branch 'BENTLEY_materials_line_style' of https://github.com/Ces…
danielzhong 42e2055
Update README.md
danielzhong 28cfc25
Update extensions/2.0/Vendor/BENTLEY_materials_line_style/schema/mate…
danielzhong 57d373b
Add CumulativeDistance
danielzhong 3368ec3
Update extensions/2.0/Vendor/BENTLEY_materials_line_style/README.md
danielzhong f8ed3d0
update
danielzhong 8563506
Update README.md
danielzhong 6823cd3
Update README.md
danielzhong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
77 changes: 77 additions & 0 deletions
77
extensions/2.0/Vendor/BENTLEY_material_line_style/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| <!-- | ||
| Copyright 2015-2025 The Khronos Group Inc. | ||
| SPDX-License-Identifier: CC-BY-4.0 | ||
| --> | ||
|
|
||
| # BENTLEY_material_line_style | ||
|
|
||
| ## Contributors | ||
|
|
||
| * Paul Connelly, Bentley Systems, [@pmconne](https://github.com/pmconne) | ||
| * Daniel Zhong, Bentley Systems, [@danielzhong](https://github.com/danielzhong) | ||
|
|
||
| ## Status | ||
|
|
||
| Draft | ||
|
|
||
| ## Dependencies | ||
|
|
||
| Written against the glTF 2.0 spec. | ||
|
|
||
| ## Overview | ||
|
|
||
| Lines are fundamental elements in many 3D modeling and computer-aided design (CAD) environments. They are used to annotate two- and three-dimensional visualizations, with variations in width and dash patterns conveying semantic meaning or emphasis. | ||
|
|
||
| The `BENTLEY_material_line_style` extension defines a method for describing the visual style of lines within glTF material. It enables authors to specify line thickness and a repeating dash pattern. | ||
|
|
||
| This extension introduces two primary properties controlling line appearance: | ||
|
|
||
| - `width`: the pixel width of the rendered line | ||
| - `pattern`: a string of arbitrary length representing a repeating sequence of lit (`-`) and unlit (` `) pixels | ||
|
|
||
| ## Specifying Line Styles | ||
|
|
||
| The `BENTLEY_material_line_style` extension is applied to a material. | ||
| When that material is used by any line-type primitive, or by the edges described by the `EXT_mesh_primitive_edge_visibility` extension, it defines the **width** and **pattern** with which those lines are rendered. | ||
|
danielzhong marked this conversation as resolved.
Outdated
|
||
|
|
||
| ### Width | ||
|
|
||
| The `width` property specifies the line’s thickness **in screen pixels**. | ||
| The value of `width` must be greater than `0`. | ||
|
danielzhong marked this conversation as resolved.
Outdated
|
||
|
|
||
| For each line segment, implementations should extrude geometry by half this width on each side of the segment’s centerline, perpendicular to its direction. | ||
|
danielzhong marked this conversation as resolved.
Outdated
|
||
|
|
||
|
|
||
| ### Pattern | ||
|
|
||
| The `pattern` property specifies a **repeating on/off pixel sequence** to be applied along the length of the line. | ||
| It is expressed as a string of arbitrary length, where each character corresponds to one pixel: | ||
|
danielzhong marked this conversation as resolved.
Outdated
|
||
|
|
||
| - `-` (hyphen): lit pixel (on) | ||
| - ` ` (space): unlit pixel (off) | ||
|
|
||
| The pattern repeats cyclically once the end of the string is reached. | ||
| The first character determines whether the first pixel drawn is lit or unlit. | ||
|
|
||
| Example patterns: | ||
|
|
||
| | Pattern | Description | | ||
| |----------|--------------| | ||
| | `---` | solid line | | ||
| | `- -` | dotted line | | ||
| | `-- ` | dashed line | | ||
| | `- - -- -` | custom pattern | | ||
|
|
||
| The pattern is applied continuously along each continuous line string or loop. | ||
|
|
||
| ## Implementation Notes | ||
|
|
||
| Because many graphics APIs do not support line primitives with a width larger than 1, tessellation is generally required to draw wide lines. Implementations may smooth out the tesselated lines by, e.g., inserting additional triangles at the joints to round them. | ||
|
|
||
| The pattern should be continuous along the length of each continuous line string or line loop. | ||
|
|
||
| Implementations may choose to aggregate the set of unique dash patterns into a texture with one row per pattern to be indexed by the shader program when applying a line style's pattern. | ||
|
|
||
| ## JSON Schema | ||
|
|
||
| * [material.BENTLEY_material_line_style.schema.json](schema/material.BENTLEY_material_line_style.schema.json) | ||
23 changes: 23 additions & 0 deletions
23
...endor/BENTLEY_material_line_style/schema/material.BENTLEY_material_line_style.schema.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "$schema": "http://json-schema.org/draft-04/schema", | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs to be updated. We are using
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated! Thanks! |
||
| "title": "BENTLEY_material_line_style extension", | ||
| "type": "object", | ||
| "description": "Specifies line width and dash pattern for CAD-style visualization.", | ||
| "allOf": [ | ||
| { "$ref": "glTFProperty.schema.json" } | ||
| ], | ||
| "properties": { | ||
| "width": { | ||
| "type": "number", | ||
| "description": "Width of the line in screen pixels. Must be > 0.", | ||
| "minimum": 0 | ||
| }, | ||
| "pattern": { | ||
| "type": "string", | ||
| "description": "Arbitrary-length bitfield string representing on/off pattern. '-' = lit, ' ' = unlit." | ||
| }, | ||
| "extensions": {}, | ||
| "extras": {} | ||
| }, | ||
| "required": ["width", "pattern"] | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.