It sounds like you're aiming to create a 3D tree model where the trunk is only present at the base, with the base being the widest part of the tree. Currently, your profile seems to introduce a trunk-like structure both at the top and bottom, which might not be the desired outcome. Let's walk through how to adjust your profile to achieve a tree with a single trunk at the base.
Understanding the Profile Coordinates
Your current profile is defined by a series of (x, y) coordinates:
When you perform a surface of revolution (srev) around the Y-axis (360 degrees), these coordinates generate the 3D shape of the tree. However, as you've noticed, this profile inadvertently adds a trunk-like structure at both the top and bottom.
Steps to Modify the Profile
To ensure that the trunk is only present at the base and that the base is the widest part of the tree, follow these steps:
Ensure a Single Maximum Width at the Base:
The base (lowest y value) should have the maximum absolute x value, representing the trunk's width.
As you move from the base upwards (increasing y), the x values should consistently decrease to create a tapering effect without introducing additional trunk segments.
Remove or Adjust Points Causing Upper Trunk:
Identify and eliminate points in your profile that increase the x value above a certain y level, which inadvertently adds a trunk-like structure at the top.
Simplify the Profile for Clarity:
Avoid repeating or redundant points that can cause flat regions or unintended geometries in the final 3D model.
Revised Profile Coordinates
Here's a modified version of your profile that ensures the trunk is only at the base:
Base (y = -0.4 to y = 0): Maintains a consistent x = -0.8 to represent the trunk without variation. This ensures that the trunk remains uniform at the base.
Canopy (y = 0.2 to y = 1.6): Gradually decreases the absolute x values from -0.7 to 0 as y increases, creating a natural tapering towards the top without introducing additional trunk segments.
Implementing the Changes
Replace your current profile with the revised coordinates above. Here's how the updated section of your code might look:
Coordinate Order: Ensure that the coordinates are ordered from the base upwards (from lowest y to highest y). Some software requires profiles to start from one end (commonly the base), so adjusting the order accordingly can prevent unintended geometries.
Consistency in X Values: By keeping the x value constant at the base and ensuring it only decreases (in absolute terms) as you move upwards, the trunk remains singular and uniform.
Visual Verification
After implementing these changes, perform the surface of revolution (srev) to generate the 3D tree model. You should observe a tree with:
A consistent trunk at the base.
A smoothly tapering canopy without additional trunk sections at the top.
Further Enhancements
If you wish to add more complexity to your tree model, such as branches or varying trunk thickness, consider the following:
Branches: Introduce additional profiles or use modeling techniques to add branches at desired heights.
Texture and Material: Apply textures or materials to differentiate the trunk from the foliage realistically.
Scaling: Implement scaling transformations during the revolution to mimic natural irregularities in tree shapes.
Feel free to adjust the coordinates further to match the specific aesthetic or structural requirements of your project. If you encounter any issues or need additional assistance, don't hesitate to ask!