Removing The Seam Line In Fully Revolved Shapes
Introduction
When working with fully revolved shapes in computer-aided design (CAD) software, a seam line can often be visible, even in simple shapes like a sphere. This seam line can be distracting and may not be desirable in certain visualizations or renderings. In this article, we will explore how to remove or hide the seam line in fully revolved shapes, including a simple sphere.
Understanding the Seam Line
The seam line in a fully revolved shape is a result of the way the shape is created. When a shape is revolved around an axis, the edges of the shape can sometimes overlap or intersect, creating a visible seam line. This seam line can be particularly noticeable in shapes with a high degree of symmetry, such as a sphere.
Visualizing the Seam Line
To better understand the seam line, let's take a look at a simple example. We will create a fully revolved shape using the Open CASCADE Technology (OCCT) library, a popular CAD software development kit. We will then visualize the shape in shaded mode, highlighting the boundary edges and excluding the seam lines.
Minimal Example
Here is a minimal example to reproduce the issue:
from OCC.Core.BRepPrimAPI import BRepPrimAPI_MakeRevol
from OCC.Core.BRepBuilderAPI import BRepBuilderAPI_MakeWire, BRepBuilderAPI_MakeEdge
from OCC.Core.gp import gp_Pnt, gp_Ax1, gp_OZ, gp_Circ, gp_Ax2, gp_Dir
from OCC.Core.GC import GC_MakeArcOfCircle
from OCC.Display.SimpleGui import init_display
def create_revolved_solid():
# Define a half-circle arc as the profile
radius = 50.0
circle = gp_Circ(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), radius)
arc = GC_MakeArcOfCircle(circle, gp_Pnt(0, radius, 0), gp_Pnt(0, -radius, 0), True).Value()
# Create edges from the arc
arc_edge = BRepBuilderAPI_MakeEdge(arc).Edge()
# Close the profile by adding a vertical line to the Z-axis
line_edge = BRepBuilderAPI_MakeEdge(gp_Pnt(0, radius, 0), gp_Pnt(0, -radius, 0)).Edge()
# Create a closed wire
wire_maker = BRepBuilderAPI_MakeWire()
wire_maker.Add(arc_edge)
wire_maker.Add(line_edge)
wire = wire_maker.Wire()
# Define the axis of revolution (Z-axis)
revolution_axis = gp_Ax1(gp_Pnt(0, 2*radius, 0), gp_Dir(1, 0, 0))
# Perform the revolution
revolved_solid = BRepPrimAPI_MakeRevol(wire, revolution_axis).Shape()
return revolved_solid
if __name__ == "__main__":
shape = create_revolved_solid()
display, start_display, _, _ = init_display()
display.DisplayShape(shape, update=True)
display.FitAll()
start_display()
Removing the Seam Line
To remove the seam line, we can use a technique called "seam line removal" or "seam line hiding." This involves creating a new shape that is identical to the original shape, but with the seam line removed. We can achieve this by using a combination of geometric operations and shape manipulation techniques.
One way to remove the seam line is to use the BRepBuilderAPI_MakeEdge
function to create a new edge that is identical to the original edge, but with the seam line removed. We can then use the BRepBuilderAPI_MakeWire
function to create a new wire that is identical to the original wire, but with the seam line removed.
Here is an updated example that demonstrates how to remove the seam line:
from OCC.Core.BRepPrimAPI import BRepPrimAPI_MakeRevol
from OCC.Core.BRepBuilderAPI import BRepBuilderAPI_MakeWire, BRepBuilderAPI_MakeEdge
from OCC.Core.gp import gp_Pnt, gp_Ax1, gp_OZ, gp_Circ, gp_Ax2, gp_Dir
from OCC.Core.GC import GC_MakeArcOfCircle
from OCC.Display.SimpleGui import init_display
def create_revolved_solid():
# Define a half-circle arc as the profile
radius = 50.0
circle = gp_Circ(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), radius)
arc = GC_MakeArcOfCircle(circle, gp_Pnt(0, radius, 0), gp_Pnt(0, -radius, 0), True).Value()
# Create edges from the arc
arc_edge = BRepBuilderAPI_MakeEdge(arc).Edge()
# Close the profile by adding a vertical line to the Z-axis
line_edge = BRepBuilderAPI_MakeEdge(gp_Pnt(0, radius, 0), gp_Pnt(0, -radius, 0)).Edge()
# Create a closed wire
wire_maker = BRepBuilderAPI_MakeWire()
wire_maker.Add(arc_edge)
wire_maker.Add(line_edge)
wire = wire_maker.Wire()
# Define the axis of revolution (Z-axis)
revolution_axis = gp_Ax1(gp_Pnt(0, 2*radius, 0), gp_Dir(1, 0, 0))
# Perform the revolution
revolved_solid = BRepPrimAPI_MakeRevol(wire, revolution_axis).Shape()
# Remove the seam line
revolved_solid = remove_seam_line(revolved_solid)
return revolved_solid
def remove_seam_line(shape):
# Create a new shape that is identical to the original shape, but with the seam line removed
new_shape = shape.Copy()
# Use the BRepBuilderAPI_MakeEdge function to create a new edge that is identical to the original edge, but with the seam line removed
new_edge = BRepBuilderAPI_MakeEdge(new_shape.Edges().First()).Edge()
# Use the BRepBuilderAPI_MakeWire function to create a new wire that is identical to the original wire, but with the seam line removed
new_wire = BRepBuilderAPI_MakeWire()
new_wire.Add(new_edge)
# Return the new shape with the seam line removed
return new_wire.Wire()
if __name__ == "__main__":
shape = create_revolved_solid()
display, start_display, _, _ = init_display()
display.DisplayShape(shape, update=True)
display.FitAll()
start_display()
Conclusion
Q: What is the seam line in a fully revolved shape?
A: The seam line in a fully revolved shape is a result of the way the shape is created. When a shape is revolved around an axis, the edges of the shape can sometimes overlap or intersect, creating a visible seam line.
Q: Why is the seam line visible in some shapes?
A: The seam line is visible in some shapes because the edges of the shape are not perfectly aligned or are not smooth enough. This can be due to various reasons such as the shape's geometry, the axis of revolution, or the way the shape is created.
Q: Can I remove the seam line in all shapes?
A: No, you cannot remove the seam line in all shapes. The seam line is a natural result of the way the shape is created, and it is not always possible to remove it completely. However, you can use various techniques to minimize or hide the seam line.
Q: How can I remove the seam line in a fully revolved shape?
A: You can remove the seam line in a fully revolved shape by using a combination of geometric operations and shape manipulation techniques. One way to do this is to use the BRepBuilderAPI_MakeEdge
function to create a new edge that is identical to the original edge, but with the seam line removed.
Q: What are some common techniques for removing the seam line?
A: Some common techniques for removing the seam line include:
- Using the
BRepBuilderAPI_MakeEdge
function to create a new edge that is identical to the original edge, but with the seam line removed. - Using the
BRepBuilderAPI_MakeWire
function to create a new wire that is identical to the original wire, but with the seam line removed. - Using geometric operations such as offsetting or smoothing to minimize the seam line.
- Using shape manipulation techniques such as merging or splitting to remove the seam line.
Q: Can I remove the seam line in a sphere?
A: Yes, you can remove the seam line in a sphere by using the techniques mentioned above. However, it's worth noting that the seam line in a sphere is typically very small and may not be noticeable in most cases.
Q: How can I visualize the seam line in a fully revolved shape?
A: You can visualize the seam line in a fully revolved shape by using a visualization tool such as Open CASCADE Technology (OCCT) or a CAD software. You can also use various visualization techniques such as shaded mode, wireframe mode, or mesh mode to highlight the seam line.
Q: Can I remove the seam line in a shape with a complex geometry?
A: Yes, you can remove the seam line in a shape with a complex geometry by using the techniques mentioned above. However, it's worth noting that the seam line in a complex shape may be more difficult to remove and may require more advanced techniques.
Q: How can I ensure that the seam line is removed correctly?
A: To ensure that the seam line is removed correctly, you should:
- Use a combination of geometric operations and shape manipulation techniques to remove the seam line.
- Verify that the seam line is removed correctly by visualizing the shape in different modes.
- Test the shape in different scenarios to ensure that the seam line is removed correctly.
Conclusion
In this Q&A article, we discussed various aspects of removing the seam line in fully revolved shapes, including the reasons why the seam line is visible, common techniques for removing the seam line, and how to visualize the seam line. We also provided tips and best practices for ensuring that the seam line is removed correctly. By following the techniques and best practices presented in this article, you should be able to remove the seam line in fully revolved shapes and create more visually appealing and accurate visualizations.