MCPcopy
hub / github.com/widgetti/ipyvolume / trim

Method trim

js/src/values.ts:102–113  ·  view source on GitHub ↗
(new_length)

Source from the content-addressed store, hash-verified

100 }
101
102 trim(new_length) {
103 (this.array as any) = mapValues(this.array, (array: []) => {
104 return array.length === new_length ? array : array.slice(0, new_length);
105 });
106 (this.array_vec3 as any) = mapValues(this.array_vec3, (array_vec3: []) => {
107 return array_vec3.length === new_length * 3 ? array_vec3 : array_vec3.slice(0, new_length * 3);
108 });
109 (this.array_vec4 as any) = mapValues(this.array_vec4, (array_vec4: []) => {
110 return (array_vec4.length === new_length * 4) ? array_vec4 : array_vec4.slice(0, new_length * 4);
111 });
112 this.length = new_length;
113 }
114
115 ensure_array(name_or_names) {
116 const names = isArray(name_or_names) ? name_or_names : [name_or_names];

Callers 2

create_meshMethod · 0.95
create_meshMethod · 0.95

Calls 1

mapValuesFunction · 0.85

Tested by

no test coverage detected