Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PAnTHer
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
puma
client
PAnTHer
Commits
f906921f
Commit
f906921f
authored
3 months ago
by
Lucio Zambon
Browse files
Options
Downloads
Patches
Plain Diff
Update file bending_2400.js
parent
87af0b00
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
components/src/bending_2400.js
+58
-0
58 additions, 0 deletions
components/src/bending_2400.js
with
58 additions
and
0 deletions
components/src/bending_2400.js
0 → 100644
+
58
−
0
View file @
f906921f
import
*
as
THREE
from
'
three
'
;
// Bending 2400
export
function
bending_2400
(
param
)
{
const
length
=
param
&&
typeof
param
.
length
==
"
number
"
?
param
.
length
:
2400
const
bending_2400Container
=
new
THREE
.
Object3D
();
const
bending_2400Object
=
new
THREE
.
Object3D
();
// main body
const
loader
=
new
THREE
.
TextureLoader
();
const
texture
=
loader
.
load
(
'
./components/dipole.png
'
);
const
textureTop
=
texture
.
clone
();
const
textureSide
=
texture
.
clone
();
textureTop
.
center
.
set
(
0.5
,
0.5
);
textureTop
.
rotation
=
THREE
.
MathUtils
.
degToRad
(
90
);
textureSide
.
offset
.
set
(
0
,
0.8
);
const
dmaterial
=
new
THREE
.
MeshLambertMaterial
({
map
:
texture
});
const
face
=
new
THREE
.
MeshBasicMaterial
({
map
:
texture
});
const
faceTop
=
new
THREE
.
MeshBasicMaterial
({
map
:
textureTop
});
const
faceSide
=
new
THREE
.
MeshBasicMaterial
({
map
:
textureSide
});
const
materials
=
[
face
,
face
,
faceTop
,
faceSide
,
faceSide
,
faceSide
];
const
d1geometry
=
new
THREE
.
BoxGeometry
(
500
,
700
,
length
);
const
d1mesh
=
new
THREE
.
Mesh
(
d1geometry
,
materials
);
d1mesh
.
position
.
set
(
100
,
100
,
0
);
bending_2400Object
.
add
(
d1mesh
);
// longitudinal coil
const
dipoleCoil
=
new
THREE
.
Object3D
();
const
coilmaterial
=
new
THREE
.
MeshLambertMaterial
({
color
:
0xc08000
});
const
d4geometry
=
new
THREE
.
BoxGeometry
(
100
,
100
,
length
);
const
d4mesh
=
new
THREE
.
Mesh
(
d4geometry
,
coilmaterial
);
d4mesh
.
position
.
set
(
-
200
,
0
,
0
);
dipoleCoil
.
add
(
d4mesh
);
// cylinder coil front
const
d2geometry
=
new
THREE
.
CylinderGeometry
(
150
/*radiusTop*/
,
150
/*radiusBottom*/
,
100
/*height*/
,
20
/*radialSegments*/
,
2
/*heightSegments*/
,
false
/*openEnded*/
,
Math
.
PI
*
1.5
/*thetaStart*/
,
Math
.
PI
*
1
/*thetaLength*/
);
const
d2mesh
=
new
THREE
.
Mesh
(
d2geometry
,
coilmaterial
);
d2mesh
.
position
.
set
(
-
100
,
0
,
length
/
2
);
dipoleCoil
.
add
(
d2mesh
);
// cylinder coil back
const
d3geometry
=
new
THREE
.
CylinderGeometry
(
150
/*radiusTop*/
,
150
/*radiusBottom*/
,
100
/*height*/
,
20
/*radialSegments*/
,
2
/*heightSegments*/
,
false
/*openEnded*/
,
Math
.
PI
*
0.5
/*thetaStart*/
,
Math
.
PI
*
1
/*thetaLength*/
);
const
d3mesh
=
new
THREE
.
Mesh
(
d3geometry
,
coilmaterial
);
d3mesh
.
position
.
set
(
-
100
,
0
,
-
length
/
2
);
dipoleCoil
.
add
(
d3mesh
);
dipoleCoil
.
position
.
set
(
0
,
0
,
0
);
bending_2400Object
.
add
(
dipoleCoil
);
// duplicate coil
const
dipoleCoil2
=
dipoleCoil
.
clone
();
dipoleCoil2
.
position
.
set
(
0
,
200
,
0
);
bending_2400Object
.
add
(
dipoleCoil2
);
bending_2400Object
.
position
.
set
(
0
,
0
,
0
);
bending_2400Container
.
add
(
bending_2400Object
);
return
bending_2400Container
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
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