Alpha helix and Beta sheet (2021)
Posted: 2021-May-01 9:02
Each of these three scripts generates a motif appeared in secondary structure of proteins; (1) a flexible (bendable and elastic) alpha-helix using lathe functions and skeleton (2) a beta-sheet by giving a cylindrical NURBS squared corners (3) a beta-sheet using blending technique of patches.
![Image](images/myimg/postimg/ahelixbsheet1/010a.jpg)
1. Generating an alpha helix
The first script makes a small rectangle at the first. It is used as a cross section of the ribbon-like helix.
![Image](images/myimg/postimg/ahelixbsheet1/020a.jpg)
Lathe functions extrude a face to 3D helix about an axis. We make a left-handed helix here.
![Image](images/myimg/postimg/ahelixbsheet1/030a.jpg)
The script adjusts orientation and location and attaches it to a skeleton that has a series of bones. Each joint has DOF (degree of freedom) for rotation about 2 axes and sliding so that we can stretch the skeleton by pulling vertically or can bend flexibly by pulling horizontally.
![Image](images/myimg/postimg/ahelixbsheet1/040a.jpg)
![Image](images/myimg/postimg/ahelixbsheet1/050a.jpg)
2. Generating a cylindrical NURBS beta sheet
The second script makes a cylindrical NURBS at the first because there is no API function to make a NURBS cube. In order to simplify the process, it does not have bottom cap.
In addition, trueSpace's "NURBS Cube" button with "One patch" on would probably make a cylinder and change control points in the similar way with the script.
![Image](images/myimg/postimg/ahelixbsheet1/060a.jpg)
Changes the cylinder into a quadrangular prism by shortening the length of control arrows. If you would like to check the position of the control points, remove "#" from the commented lines near CreateCube().
![Image](images/myimg/postimg/ahelixbsheet1/070a.jpg)
We call the bottom latitude "the first floor" here. The script widen the control points on the second floor and lift them up to the same level with the 3rd floor.
![Image](images/myimg/postimg/ahelixbsheet1/080a.jpg)
Narrows the bottom so that it becomes almost a line segment, and adjust its level, etc.
![Image](images/myimg/postimg/ahelixbsheet1/100a.jpg)
Adds two altitudes just upper and below the inverted "eaves" in stead of unite the 2nd and 3rd floor. They prevent crack at the eaves.
![Image](images/myimg/postimg/ahelixbsheet1/110a.jpg)
That's the steps that the script makes a beta sheet model. It subsequently pulls some altitudes horizontally, and adjust vertical size, thickness, etc.
![Image](images/myimg/postimg/ahelixbsheet1/120a.jpg)
![Image](images/myimg/postimg/ahelixbsheet1/130a.jpg)
You might think rotating 45° and stretching vertically before deforming the NURBS would make the script simpler, but that does not contribute much because the information of rotation and scaling are stored to different place from vertices and the coordinate of control points are unchanged after the object was rotate or scaled.
3. Generating a beta sheet by blending patches
The third script makes a cube at the first and shorted its heights.
![Image](images/myimg/postimg/ahelixbsheet1/140a.jpg)
Deletes a vertical edge from it to make the arrowhead.
![Image](images/myimg/postimg/ahelixbsheet1/150a.jpg)
Changes its orientation and adds a NURBS plane with several sections as the bottom panel of the shaft.
![Image](images/myimg/postimg/ahelixbsheet1/160a.jpg)
Adds more four NURBS planes as the top, side, and end panel of the shaft. Stiches them using blend function.
![Image](images/myimg/postimg/ahelixbsheet1/170a.jpg)
4. Summary and notes
You get three objects after executed the three scripts, and can deform them flexibly.
![Image](images/myimg/postimg/ahelixbsheet1/180a.jpg)
(1) The helix (right in the image)
It is not a NURBS object but a plain object + a skeleton. It can be shrunk/extended vertically by right-dragging a bone, and can be bend flexibly by left-clicking a bone. The script specifies degree of freedom (DOF) for each joint.
Please note that the script does not set parameters for muscle and tendon but only bare minimum things. In case you receive glitchy result, adjust values for them before running the script; Right click "Edit muscles" to open "Muscle Properties", and set all five vales to zero. Right click "Edit Tendons" to open "Skinning" panel, and adjust "Tendon Rates" so that you get more preferable results.
(2) The arrow (center)
It's a NURBS object and its latitude and longitude can be moved flexibly without making sharp corners unlike plain objects. After right clicking it, hover your mouse pointer over a latitude or longitude. Click it to select, and move/rotate/scale it. Right clicking the ground ends the edit mode.
(3) The arrow (left)
It's similar to the previous one but you must do multiple selection by ctrl clicking each edge of a latitude before move/rotate/scale it. There might be room for improving the script. Probably trueSpace's "NURBS Cube" button with "One patch" off would do in the similar way, but it allow users to select each latitude by one clicking.
Requirements:
script file 1: ptsxpy 0.0.14 or higher
![Image](images/myimg/postimg/_ver_icon/py2_a.png)
![Image](images/myimg/postimg/_ver_icon/ts66_a.png)
script file 2 and 3: tS5.1 or higher + ptsxpy 0.0.14 or higher
![Image](images/myimg/postimg/_ver_icon/py2_a.png)
![Image](images/myimg/postimg/_ver_icon/ts66_a.png)
![Image](images/myimg/postimg/ahelixbsheet1/010a.jpg)
1. Generating an alpha helix
The first script makes a small rectangle at the first. It is used as a cross section of the ribbon-like helix.
![Image](images/myimg/postimg/ahelixbsheet1/020a.jpg)
Lathe functions extrude a face to 3D helix about an axis. We make a left-handed helix here.
![Image](images/myimg/postimg/ahelixbsheet1/030a.jpg)
The script adjusts orientation and location and attaches it to a skeleton that has a series of bones. Each joint has DOF (degree of freedom) for rotation about 2 axes and sliding so that we can stretch the skeleton by pulling vertically or can bend flexibly by pulling horizontally.
![Image](images/myimg/postimg/ahelixbsheet1/040a.jpg)
![Image](images/myimg/postimg/ahelixbsheet1/050a.jpg)
2. Generating a cylindrical NURBS beta sheet
The second script makes a cylindrical NURBS at the first because there is no API function to make a NURBS cube. In order to simplify the process, it does not have bottom cap.
In addition, trueSpace's "NURBS Cube" button with "One patch" on would probably make a cylinder and change control points in the similar way with the script.
![Image](images/myimg/postimg/ahelixbsheet1/060a.jpg)
Changes the cylinder into a quadrangular prism by shortening the length of control arrows. If you would like to check the position of the control points, remove "#" from the commented lines near CreateCube().
![Image](images/myimg/postimg/ahelixbsheet1/070a.jpg)
We call the bottom latitude "the first floor" here. The script widen the control points on the second floor and lift them up to the same level with the 3rd floor.
![Image](images/myimg/postimg/ahelixbsheet1/080a.jpg)
Narrows the bottom so that it becomes almost a line segment, and adjust its level, etc.
![Image](images/myimg/postimg/ahelixbsheet1/100a.jpg)
Adds two altitudes just upper and below the inverted "eaves" in stead of unite the 2nd and 3rd floor. They prevent crack at the eaves.
![Image](images/myimg/postimg/ahelixbsheet1/110a.jpg)
That's the steps that the script makes a beta sheet model. It subsequently pulls some altitudes horizontally, and adjust vertical size, thickness, etc.
![Image](images/myimg/postimg/ahelixbsheet1/120a.jpg)
![Image](images/myimg/postimg/ahelixbsheet1/130a.jpg)
You might think rotating 45° and stretching vertically before deforming the NURBS would make the script simpler, but that does not contribute much because the information of rotation and scaling are stored to different place from vertices and the coordinate of control points are unchanged after the object was rotate or scaled.
3. Generating a beta sheet by blending patches
The third script makes a cube at the first and shorted its heights.
![Image](images/myimg/postimg/ahelixbsheet1/140a.jpg)
Deletes a vertical edge from it to make the arrowhead.
![Image](images/myimg/postimg/ahelixbsheet1/150a.jpg)
Changes its orientation and adds a NURBS plane with several sections as the bottom panel of the shaft.
![Image](images/myimg/postimg/ahelixbsheet1/160a.jpg)
Adds more four NURBS planes as the top, side, and end panel of the shaft. Stiches them using blend function.
![Image](images/myimg/postimg/ahelixbsheet1/170a.jpg)
4. Summary and notes
You get three objects after executed the three scripts, and can deform them flexibly.
![Image](images/myimg/postimg/ahelixbsheet1/180a.jpg)
(1) The helix (right in the image)
It is not a NURBS object but a plain object + a skeleton. It can be shrunk/extended vertically by right-dragging a bone, and can be bend flexibly by left-clicking a bone. The script specifies degree of freedom (DOF) for each joint.
Please note that the script does not set parameters for muscle and tendon but only bare minimum things. In case you receive glitchy result, adjust values for them before running the script; Right click "Edit muscles" to open "Muscle Properties", and set all five vales to zero. Right click "Edit Tendons" to open "Skinning" panel, and adjust "Tendon Rates" so that you get more preferable results.
(2) The arrow (center)
It's a NURBS object and its latitude and longitude can be moved flexibly without making sharp corners unlike plain objects. After right clicking it, hover your mouse pointer over a latitude or longitude. Click it to select, and move/rotate/scale it. Right clicking the ground ends the edit mode.
(3) The arrow (left)
It's similar to the previous one but you must do multiple selection by ctrl clicking each edge of a latitude before move/rotate/scale it. There might be room for improving the script. Probably trueSpace's "NURBS Cube" button with "One patch" off would do in the similar way, but it allow users to select each latitude by one clicking.
Requirements:
script file 1: ptsxpy 0.0.14 or higher
![Image](images/myimg/postimg/_ver_icon/py3_a.png)
![Image](images/myimg/postimg/_ver_icon/py2_a.png)
![Image](images/myimg/postimg/_ver_icon/ts43_a.png)
![Image](images/myimg/postimg/_ver_icon/ts51_a.png)
![Image](images/myimg/postimg/_ver_icon/ts60_a.png)
![Image](images/myimg/postimg/_ver_icon/ts66_a.png)
script file 2 and 3: tS5.1 or higher + ptsxpy 0.0.14 or higher
![Image](images/myimg/postimg/_ver_icon/py3_a.png)
![Image](images/myimg/postimg/_ver_icon/py2_a.png)
![Image](images/myimg/postimg/_ver_icon/ts51_a.png)
![Image](images/myimg/postimg/_ver_icon/ts60_a.png)
![Image](images/myimg/postimg/_ver_icon/ts66_a.png)