To make the entity color semi-transparent you need simply to set its color Alpha component to a value lower than 255. The entity color depends on two factors:
- Color method (byEntity, byLayer, byParent)
- Viewport display mode (Shaded, Rendered)
If you are using Rendered display mode, for example, the entity color is determined by the relevant Material.Diffuse.A value while the relevant material can be the EntityMaterial, the referenced Layer.Material or BlockReference.Material.
Accurate Transparency
Eyeshot features blended transparency, a very fast and inaccurate transparency method. An additional accurate transparency method is available but it has a number of limitations:
- Slow speed
- Doesn't propagate inside block/blockReference
- May crash on invalid triangles
- Need to be recomputed every time one object/layer is hidden
- Textured objects are not supported
- Wires are not supported
Accurate transparency can be activated using:
design1.AccurateTransparency = true;
Accurate transparency is based on Binary Space Partitioning, this requires a geometry pre-processing stage that could take some time. To improve the speed of the pre-processing stage you can try decreasing the Design.Entities.MaxCandidates value. MaxCandidates represents the number of samplings the pre-processing stage takes to simplify the semi-transparent geometry. Increasing it, you'll get a better frame rate (fps) when you display the model while decreasing it you improve the speed of the pre-processing stage.
Another option to increase your scene frame rate is to set Design.Entities.FrontFacingOnly = true. In this case, only front-facing semi-transparent triangles will be drawn. Combined with visible sharp edges can be a great compromise between speed and accuracy of your scene.
Finally, you may also consider calling Design.Entities.RegenAllCurved(<biggest_acceptable_tolerance>) to reduce the total number of triangles involved in transparency.
When you set Entity.Visible to false for a semi-transparent entity you need to call manually Design.Entities.UpdateBoundingBox() to ensure the geometry pre-processing stage takes place again. UpdateBoundingBox() will also update the shadow and the model bounding box (removing entities just hidden).
Comments
I tested MaxCandidates parameter, but the result is not good for me.
In fact I have to make a hole at mesh entity like attachments.
If fast alpha mapping had some restrictions, I can use other method for hole with mesh.
And I tested boolean function too, but it was not suitable.
If eyeshot has function like clipping polygon, it will be perfect.
Is there any ideas for this problem?
Please sign in to leave a comment.