Explorar el Código

unitcell repr attachment parameter

Alexander Rose hace 4 años
padre
commit
6e39188f0b
Se han modificado 2 ficheros con 6 adiciones y 6 borrados
  1. 5 5
      src/mol-repr/shape/model/unitcell.ts
  2. 1 1
      src/mol-repr/shape/representation.ts

+ 5 - 5
src/mol-repr/shape/model/unitcell.ts

@@ -34,7 +34,7 @@ const CellRef = {
     model: 'Model'
 };
 
-const CellAttachement = {
+const CellAttachment = {
     corner: 'Corner',
     center: 'Center'
 };
@@ -44,12 +44,12 @@ const CellParams = {
     cellColor: PD.Color(ColorNames.orange),
     cellScale: PD.Numeric(2, { min: 0.1, max: 5, step: 0.1 }),
     ref: PD.Select('model', PD.objectToOptions(CellRef), { isEssential: true }),
-    attachement: PD.Select('corner', PD.objectToOptions(CellAttachement), { isEssential: true }),
+    attachment: PD.Select('corner', PD.objectToOptions(CellAttachment), { isEssential: true }),
 };
-type MeshParams = typeof CellParams
+type CellParams = typeof CellParams
 
 const UnitcellVisuals = {
-    'mesh': (ctx: RepresentationContext, getParams: RepresentationParamsGetter<UnitcellData, MeshParams>) => ShapeRepresentation(getUnitcellShape, Mesh.Utils),
+    'mesh': (ctx: RepresentationContext, getParams: RepresentationParamsGetter<UnitcellData, CellParams>) => ShapeRepresentation(getUnitcellShape, Mesh.Utils),
 };
 
 export const UnitcellParams = {
@@ -64,7 +64,7 @@ function getUnitcellMesh(data: UnitcellData, props: UnitcellProps, mesh?: Mesh)
     const { fromFractional } = data.symmetry.spacegroup.cell;
 
     Vec3.copy(tmpRef, data.ref);
-    if (props.attachement === 'center') {
+    if (props.attachment === 'center') {
         Vec3.trunc(tmpRef, tmpRef);
         Vec3.subScalar(tmpRef, tmpRef, 0.5);
     } else {

+ 1 - 1
src/mol-repr/shape/representation.ts

@@ -29,7 +29,7 @@ export interface ShapeRepresentation<D, G extends Geometry, P extends Geometry.P
 export type ShapeGetter<D, G extends Geometry, P extends Geometry.Params<G>> = (ctx: RuntimeContext, data: D, props: PD.Values<P>, shape?: Shape<G>) => Shape<G> | Promise<Shape<G>>
 
 export interface ShapeBuilder<G extends Geometry, P extends Geometry.Params<G>> {
-    /** Hook to modify represetantion props */
+    /** Hook to modify representation props */
     modifyProps?: (props: Partial<PD.Values<P>>) => Partial<PD.Values<P>>
     /** Hook to modify representation state */
     modifyState?: (state: Partial<Representation.State>) => Partial<Representation.State>