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
5c2f83de
Commit
5c2f83de
authored
5 months ago
by
Lucio Zambon
Browse files
Options
Downloads
Patches
Plain Diff
Add new file
parent
aff0309f
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/bending_300.js
+55
-0
55 additions, 0 deletions
components/bending_300.js
with
55 additions
and
0 deletions
components/bending_300.js
0 → 100644
+
55
−
0
View file @
5c2f83de
import
*
as
THREE
from
'
three
'
;
// bending_300
export
function
bending_300
(
param
)
{
const
length
=
param
&&
typeof
param
.
length
==
"
number
"
?
param
.
length
:
300
const
bending_300Container
=
new
THREE
.
Object3D
();
const
bending_300Object
=
new
THREE
.
Object3D
();
//texture
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
(
550
,
400
,
length
);
const
d1mesh
=
new
THREE
.
Mesh
(
d1geometry
,
materials
);
d1mesh
.
position
.
set
(
-
100
,
100
,
0
);
bending_300Object
.
add
(
d1mesh
);
//Coil
const
dipoleCoil
=
new
THREE
.
Object3D
();
const
coilmaterial
=
new
THREE
.
MeshLambertMaterial
({
color
:
0xc08000
});
const
d4geometry
=
new
THREE
.
BoxGeometry
(
100
,
100
,
300
);
const
d4mesh
=
new
THREE
.
Mesh
(
d4geometry
,
coilmaterial
);
d4mesh
.
position
.
set
(
-
200
,
0
,
0
);
dipoleCoil
.
add
(
d4mesh
);
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
,
300
/
2
);
dipoleCoil
.
add
(
d2mesh
);
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
,
-
300
/
2
);
dipoleCoil
.
add
(
d3mesh
);
dipoleCoil
.
position
.
set
(
0
,
0
,
0
);
bending_300Object
.
add
(
dipoleCoil
);
const
dipoleCoil2
=
dipoleCoil
.
clone
();
dipoleCoil2
.
position
.
set
(
0
,
200
,
0
);
bending_300Object
.
add
(
dipoleCoil2
);
bending_300Object
.
position
.
set
(
0
,
0
,
0
);
bending_300Container
.
add
(
bending_300Object
);
return
bending_300Container
;
}
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