Why sphere generated by IsaacLab SphereCfg has noticeable edges on its surface

Hi, I want to use isaaclab to create a sphere, following the official tutorial I use the code below to create a sphere with physics properties.

import omni.isaac.lab.sim as sim_utils
from omni.isaac.lab.assets import ArticulationCfg, AssetBaseCfg, RigidObjectCfg
from omni.isaac.lab.scene import InteractiveScene, InteractiveSceneCfg
from omni.isaac.lab.sim import SimulationContext
from omni.isaac.lab.utils import configclass

@configclass
class CartpoleSceneCfg(InteractiveSceneCfg):
    """Configuration for a cart-pole scene."""

    # ground plane
    ground = AssetBaseCfg(prim_path="/World/defaultGroundPlane", spawn=sim_utils.GroundPlaneCfg())

    # lights
    dome_light = AssetBaseCfg(
        prim_path="/World/Light", spawn=sim_utils.DomeLightCfg(intensity=3000.0, color=(0.75, 0.75, 0.75))
    )

    # Prim
    sphere = RigidObjectCfg(
        prim_path="/World/Sphere",
        # sim_utils.UsdFileCfg()
        spawn=sim_utils.SphereCfg(
            radius=1,
            rigid_props=sim_utils.RigidBodyPropertiesCfg(),
            mass_props=sim_utils.MassPropertiesCfg(mass=1.0),
            collision_props=sim_utils.CollisionPropertiesCfg(),
            visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(0.5, 0.5, 0.5)),
        ),
        init_state=RigidObjectCfg.InitialStateCfg(lin_vel=[0.3, 0.2, 0]),
    )

However, as shown in the image, the sphere I created with code(in the middle) has noticeable edges on its surface, which could be a big problem for my work. I generated another sphere using ‘create->Shape->Sphere’ in the interface tool bar, the rendered result seem fine(left one in the image).

So I assume it is not a problem about my computer’s render ability, is there some parameters in isaacLab python functions that I can use to control the degree of simulation precision so that the generated sphere won’t have noticeable edges?

            sphere_prim.CreateAttribute("refinementEnableOverride", 
                                     Sdf.ValueTypeNames.Bool, custom=True).Set(True)
            sphere_prim.CreateAttribute("refinementLevel", 
                                     Sdf.ValueTypeNames.Int, custom=True).Set(2)

Hi, thank you for your reply! I’ve tried to set refinementLevel after InteractiveScene was created and before sim.reset() was called, however the rendered result did not change. Is there something wrong with the way I set it?

below is the new implementation of function main() which is the only one been modified, thank you!

def main():
    """Main function."""
    # Load kit helper
    sim_cfg = sim_utils.SimulationCfg(device=args_cli.device)
    sim = SimulationContext(sim_cfg)
    # Set main camera
    sim.set_camera_view([5, 0.0, 8], [0.0, 0.0, 2.0])
    # Design scene
    scene_cfg = CartpoleSceneCfg(num_envs=args_cli.num_envs, env_spacing=4.0)
    scene = InteractiveScene(scene_cfg)
    from pxr import Sdf
    sphere_prim = sim_utils.find_matching_prims("/World/Sphere")[0]
    sphere_prim.CreateAttribute("refinementEnableOverride", Sdf.ValueTypeNames.Bool, custom=True).Set(True)
    sphere_prim.CreateAttribute("refinementLevel", Sdf.ValueTypeNames.Int, custom=True).Set(2)
    # Play the simulator
    sim.reset()
    # Now we are ready!
    print(sphere_prim.GetAttribute("refinementLevel").Get())
    print("[INFO]: Setup complete...")
    # Run the simulator
    run_simulator(sim, scene)

Open a blank scene add a sphere

Save as USDA

Open in your IDE

Copy that section of code to your code

That will give you the code you need