Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Molstar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
0f0185e1
Commit
0f0185e1
authored
Feb 5, 2023
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
add fast boundary helper and unit trait
parent
a748b158
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+3
-1
3 additions, 1 deletion
CHANGELOG.md
src/mol-math/geometry/boundary.ts
+7
-3
7 additions, 3 deletions
src/mol-math/geometry/boundary.ts
src/mol-model/structure/structure/unit.ts
+9
-4
9 additions, 4 deletions
src/mol-model/structure/structure/unit.ts
with
19 additions
and
8 deletions
CHANGELOG.md
+
3
−
1
View file @
0f0185e1
...
...
@@ -11,10 +11,12 @@ Note that since we don't clearly distinguish between a public and private interf
-
The average position of the residues of the first chain should be in the first quadrant if there is more than one chain
-
Add
`HeadlessPluginContext`
and
`HeadlessScreenshotHelper`
to be used in Node.js
-
Add example
`image-renderer`
-
Fix wrong offset when rendering text with orthographic projection
-
Fix wrong offset when rendering text with orthographic projectio
n
-
Update camera/handle helper when
`devicePixelRatio`
changes
-
Add various options to customize the axes camera-helper
-
Fix issue with texture-mesh color smoothing when changing themes
-
Add fast boundary helper and corresponding unit trait
## [v3.30.0] - 2023-01-29
...
...
This diff is collapsed.
Click to expand it.
src/mol-math/geometry/boundary.ts
+
7
−
3
View file @
0f0185e1
/**
* Copyright (c) 2018-202
0
mol* contributors, licensed under MIT, See LICENSE file for more info.
* Copyright (c) 2018-202
3
mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author David Sehnal <david.sehnal@gmail.com>
* @author Alexander Rose <alexander.rose@weirdbyte.de>
...
...
@@ -22,6 +22,11 @@ function getBoundaryHelper(count: number) {
return
count
>
10
_000
?
boundaryHelperCoarse
:
boundaryHelperFine
;
}
export
function
getFastBoundary
(
data
:
PositionData
):
Boundary
{
const
box
=
Box3D
.
computeBounding
(
data
);
return
{
box
,
sphere
:
Sphere3D
.
fromBox3D
(
Sphere3D
(),
box
)
};
}
const
p
=
Vec3
();
export
function
getBoundary
(
data
:
PositionData
):
Boundary
{
...
...
@@ -29,8 +34,7 @@ export function getBoundary(data: PositionData): Boundary {
const
n
=
OrderedSet
.
size
(
indices
);
if
(
n
>
250
_000
)
{
const
box
=
Box3D
.
computeBounding
(
data
);
return
{
box
,
sphere
:
Sphere3D
.
fromBox3D
(
Sphere3D
(),
box
)
};
return
getFastBoundary
(
data
);
}
const
boundaryHelper
=
getBoundaryHelper
(
n
);
...
...
This diff is collapsed.
Click to expand it.
src/mol-model/structure/structure/unit.ts
+
9
−
4
View file @
0f0185e1
...
...
@@ -20,7 +20,7 @@ import { getAtomicPolymerElements, getCoarsePolymerElements, getAtomicGapElement
import
{
mmCIF_Schema
}
from
'
../../../mol-io/reader/cif/schema/mmcif
'
;
import
{
PrincipalAxes
}
from
'
../../../mol-math/linear-algebra/matrix/principal-axes
'
;
import
{
getPrincipalAxes
}
from
'
./util/principal-axes
'
;
import
{
Boundary
,
getBoundary
}
from
'
../../../mol-math/geometry/boundary
'
;
import
{
Boundary
,
getBoundary
,
getFastBoundary
}
from
'
../../../mol-math/geometry/boundary
'
;
import
{
Mat4
,
Vec3
}
from
'
../../../mol-math/linear-algebra
'
;
import
{
IndexPairBonds
}
from
'
../../../mol-model-formats/structure/property/bonds/index-pair
'
;
import
{
ElementSetIntraBondCache
}
from
'
./unit/bonds/element-set-intra-bond-cache
'
;
...
...
@@ -128,7 +128,8 @@ namespace Unit {
export
enum
Trait
{
None
=
0x0
,
MultiChain
=
0x1
,
Partitioned
=
0x2
Partitioned
=
0x2
,
FastBoundary
=
0x4
,
}
export
namespace
Traits
{
export
const
is
:
(
t
:
Traits
,
f
:
Trait
)
=>
boolean
=
BitFlags
.
has
;
...
...
@@ -255,7 +256,9 @@ namespace Unit {
get
boundary
()
{
if
(
this
.
props
.
boundary
)
return
this
.
props
.
boundary
;
const
{
x
,
y
,
z
}
=
this
.
model
.
atomicConformation
;
this
.
props
.
boundary
=
getBoundary
({
x
,
y
,
z
,
indices
:
this
.
elements
});
this
.
props
.
boundary
=
Traits
.
is
(
this
.
traits
,
Trait
.
FastBoundary
)
?
getFastBoundary
({
x
,
y
,
z
,
indices
:
this
.
elements
})
:
getBoundary
({
x
,
y
,
z
,
indices
:
this
.
elements
});
return
this
.
props
.
boundary
;
}
...
...
@@ -417,7 +420,9 @@ namespace Unit {
if
(
this
.
props
.
boundary
)
return
this
.
props
.
boundary
;
// TODO: support sphere radius?
const
{
x
,
y
,
z
}
=
this
.
getCoarseConformation
();
this
.
props
.
boundary
=
getBoundary
({
x
,
y
,
z
,
indices
:
this
.
elements
});
this
.
props
.
boundary
=
Traits
.
is
(
this
.
traits
,
Trait
.
FastBoundary
)
?
getFastBoundary
({
x
,
y
,
z
,
indices
:
this
.
elements
})
:
getBoundary
({
x
,
y
,
z
,
indices
:
this
.
elements
});
return
this
.
props
.
boundary
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment