Skip to content

Commit fa9aa93

Browse files
ykulbakYoram Kulbak
andauthored
#290 add support for component translucency. (#326)
--------- Co-authored-by: Yoram Kulbak <[email protected]>
1 parent e9de9ff commit fa9aa93

File tree

5 files changed

+140
-9
lines changed

5 files changed

+140
-9
lines changed

README.md

Lines changed: 93 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,18 @@ The Open CDE workgroup develops the BCF standard. The group meets every second M
8585
- [3.5.2.12 Visibility](#35212-visibility)
8686
* [Optimization rules](#optimization-rules-2)
8787
- [3.5.2.13 View setup hints](#35213-view-setup-hints)
88+
- [3.5.2.14 Translucency](#35214-translucency)
89+
* [Optimization rules](#optimization-rules-3)
90+
- [3.5.2.15 Translucency setup hints](#35215-translucency-setup-hints)
8891
+ [3.5.3 GET Viewpoint Service](#353-get-viewpoint-service)
8992
+ [3.5.4 GET Viewpoint Snapshot Service](#354-get-viewpoint-snapshot-service)
9093
+ [3.5.5 GET Viewpoint Bitmap Service](#355-get-viewpoint-bitmap-service)
9194
+ [3.5.6 GET selected Components Service](#356-get-selected-components-service)
9295
+ [3.5.7 GET colored Components Service](#357-get-colored-components-service)
9396
+ [3.5.8 GET visibility of Components Service](#358-get-visibility-of-components-service)
94-
+ [3.5.9 DELETE Viewpoint Service](#359-delete-viewpoint-service)
95-
+ [3.5.10 Determining allowed Viewpoint modifications](#3510-determining-allowed-viewpoint-modifications)
97+
+ [3.5.9 GET translucency of Components Service](#359-get-translucency-of-components-service)
98+
+ [3.5.10 DELETE Viewpoint Service](#3510-delete-viewpoint-service)
99+
+ [3.5.11 Determining allowed Viewpoint modifications](#3511-determining-allowed-viewpoint-modifications)
96100
* [3.6 Related Topics Services](#36-related-topics-services)
97101
+ [3.6.1 GET Related Topics Service](#361-get-related-topics-service)
98102
+ [3.6.2 PUT Related Topics Service](#362-put-related-topics-service)
@@ -1332,11 +1336,12 @@ Perspective and Orthogonal cameras are explained in detail in [BCF-XML](https://
13321336
#### 3.5.2.9 Components
13331337
[components.json](Schemas/Collaboration/Viewpoint/components.json)
13341338

1335-
|parameter|type|description|required|
1336-
|---------|----|-----------|--------|
1337-
| selection | array of [Component](#35210-component) | Selected components | optional |
1338-
| coloring | array of [Coloring](#35211-coloring) | Colored components | optional |
1339-
| visibility | [Visibility](#35212-visibility) | Visibility of components | mandatory |
1339+
| parameter | type | description | required |
1340+
|--------------|----------------------------------------|----------------------------|-----------|
1341+
| selection | array of [Component](#35210-component) | Selected components | optional |
1342+
| coloring | array of [Coloring](#35211-coloring) | Colored components | optional |
1343+
| visibility | [Visibility](#35212-visibility) | Visibility of components | mandatory |
1344+
| translucency | [Translucency](#35214-translucency) | Translucency of components | optional |
13401345

13411346
#### 3.5.2.10 Component
13421347
[component.json](Schemas/Collaboration/Viewpoint/component.json)
@@ -1391,6 +1396,36 @@ BCF is suitable for hiding/showing a few components. A huge list of hidden/shown
13911396
| space_boundaries_visible | boolean | Visibility of space_boundaries | optional, default false |
13921397
| openings_visible | boolean | Visibility of openings | optional, default false |
13931398

1399+
#### 3.5.2.14 Translucency
1400+
[translucency.json](Schemas/Collaboration/Viewpoint/translucency.json)
1401+
1402+
The `translucency` object decides which components are translucent and which are opaque. Visibility has a higher priority than translucency: A translucent component which is also resolved to be invisible should not be rendered.
1403+
1404+
Commonly, translucency is specified using a numeric value (alpha) ranging from 0 to 1 where a value of 0 indicates complete transparency and a value of 1 indicates complete opacity. This specification leaves the alpha value for translucent components to the vendor's discretion: when a component is resolved as 'translucent', it should rendered with an alpha greater than 0 but less than 1 in a manner consistent with the visual style of the rendering application.
1405+
1406+
##### Optimization rules
1407+
BCF is suitable for controlling the translucency of a few components. A huge list of translucent/opaque components will cause poor performance. When encoding a viewpoint follow these rules:
1408+
- Apply visibility optimization first and optimize translucency for visible components only.
1409+
- Omit the translucency element altogether if all visible components are opaque.
1410+
- If the list of translucent components is smaller than the list of opaque components: set `default_translucency` to false and put the translucent components in exceptions.
1411+
- If the list of opaque components is smaller or equals the list of translucent components: set `default_translucency` to true and put the opaque components in exceptions.
1412+
- If the size of exceptions is huge (over 1000 components), alert the user and ask them to alter the translucency setting to allow efficient encoding.
1413+
1414+
| parameter | type | description |required|
1415+
|--------------------------|-----------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|--------|
1416+
| default_translucency | boolean | If true: Make all components translucent, and make the exceptions opaque. If false: Make all components opaque and make all the exceptions translucent. | optional, default false |
1417+
| exceptions | array of [Component](#35210-component) | Components to make translucent or opaque as determined by default_translucency | optional |
1418+
| translucency_setup_hints | [View setup hints](#35215-translucency-setup-hints) | Hints about the translucency of spaces, space boundaries and openings. | optional |
1419+
1420+
#### 3.5.2.15 Translucency setup hints
1421+
[translucency_setup_hints.json](Schemas/Collaboration/Viewpoint/translucency_setup_hints.json)
1422+
1423+
| parameter |type|description| required |
1424+
|------------------------------|----|-----------|------------------------|
1425+
| spaces_translucent | boolean | Translucency of spaces | optional, default true |
1426+
| space_boundaries_translucent | boolean | Translucency of space_boundaries | optional, default true |
1427+
| openings_translucent | boolean | Translucency of openings | optional, default true |
1428+
13941429
**Example Request**
13951430

13961431
POST /bcf/3.0/projects/F445F4F2-4D02-4B2A-B612-5E456BEF9137/topics/B345F4F2-3A04-B43B-A713-5E456BEF8228/viewpoints
@@ -1486,6 +1521,17 @@ BCF is suitable for hiding/showing a few components. A huge list of hidden/shown
14861521
"space_boundaries_visible": false,
14871522
"openings_visible": true
14881523
}
1524+
},
1525+
"translucency": {
1526+
"default_translucency": true,
1527+
"exceptions": [{
1528+
"ifc_guid": "5$cshxZO9AJBebsni$z9Yk"
1529+
}],
1530+
"view_setup_hints": {
1531+
"spaces_translucent": false,
1532+
"space_boundaries_translucent": true,
1533+
"openings_translucent": false
1534+
}
14891535
}
14901536
}
14911537
}
@@ -1781,7 +1827,45 @@ Retrieve visibility of components in a viewpoint.
17811827
}
17821828
}
17831829

1784-
### 3.5.9 DELETE Viewpoint Service
1830+
### 3.5.9 GET translucency of Components Service
1831+
1832+
**Resource URL**
1833+
1834+
GET /bcf/{version}/projects/{project_id}/topics/{topic_guid}/viewpoints/{viewpoint_guid}/translucency
1835+
1836+
[visibility_GET.json](Schemas/Collaboration/Viewpoint/visibility_GET.json)
1837+
1838+
Retrieve translucency of components in a viewpoint.
1839+
1840+
**Example Request**
1841+
1842+
GET /bcf/4.0/projects/F445F4F2-4D02-4B2A-B612-5E456BEF9137/topics/B345F4F2-3A04-B43B-A713-5E456BEF8228/viewpoints/a11a82e7-e66c-34b4-ada1-5846abf39133/translucency
1843+
1844+
**Example Response**
1845+
1846+
Response Code: 200 - OK
1847+
Body:
1848+
{
1849+
"translucency": {
1850+
"default_translucency": true,
1851+
"exceptions": [
1852+
{
1853+
"ifc_guid": "2MF28NhmDBiRVyFakgdbCT",
1854+
"originating_system": "Example CAD Application",
1855+
"authoring_tool_id": "EXCAD/v1.0"
1856+
}, {
1857+
"ifc_guid": "3$cshxZO9AJBebsni$z9Yk",
1858+
}
1859+
],
1860+
"translucency_setup_hints": {
1861+
"spaces_translucent": true,
1862+
"space_boundaries_translucent": false,
1863+
"openings_translucent": true
1864+
}
1865+
}
1866+
}
1867+
1868+
### 3.5.10 DELETE Viewpoint Service
17851869

17861870
**Resource URL**
17871871

@@ -1801,7 +1885,7 @@ Note: If there is a comment associated to the viewpoint, the server might reject
18011885

18021886
Response Code: 200 - OK
18031887

1804-
### 3.5.10 Determining allowed Viewpoint modifications
1888+
### 3.5.11 Determining allowed Viewpoint modifications
18051889

18061890
The global default Viewpoint authorizations are expressed in the project schema and when Viewpoint(s) are requested with the
18071891
query parameter "includeAuthorization" equal to "true" Viewpoints will include an "authorization" field containing any local

Schemas/Collaboration/Viewpoint/components.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
},
1414
"visibility": {
1515
"$ref": "visibility.json"
16+
},
17+
"translucency": {
18+
"$ref": "translucency.json"
1619
}
1720
}
1821
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"title": "translucency",
3+
"type": "object",
4+
"properties": {
5+
"default_translucency": {
6+
"type": "boolean",
7+
"default": "false"
8+
},
9+
"exceptions": {
10+
"$ref": "component_list.json"
11+
},
12+
"view_setup_hints": {
13+
"$ref": "translucency_setup_hints.json"
14+
}
15+
}
16+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"title": "translucency_GET",
3+
"type": "object",
4+
5+
"properties": {
6+
"translucency": {
7+
"$ref": "translucency.json"
8+
}
9+
}
10+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"title": "translucency_setup_hints",
3+
"type": ["object", "null"],
4+
"properties": {
5+
"spaces_translucent": {
6+
"type": "boolean",
7+
"default": "true"
8+
},
9+
"space_boundaries_translucent": {
10+
"type": "boolean",
11+
"default": "true"
12+
},
13+
"openings_translucent": {
14+
"type": "boolean",
15+
"default": "true"
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)