How to draw an elliptic cylinder?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
xsLiu
Newbie
Newbie
Posts: 30
Joined: Wed May 22, 2019 12:00 am

How to draw an elliptic cylinder?

Post by xsLiu » Fri Sep 11, 2020 5:09 am

The axis of an elliptic cylinder is a 3D curve, and its cross section at any position is an ellipse. The 3D curve and a series of cross-section ellipses are known. That is to say, we know the 3D coordinates of the curve and ellipses at any position. I have no idea to draw the elliptic cylinder. Would you like to give me an example? Thanks a lot.
Attachments
Fig.jpg
Fig.jpg (28.55 KiB) Viewed 3206 times

Yeray
Site Admin
Site Admin
Posts: 8971
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: How to draw an elliptic cylinder?

Post by Yeray » Tue Sep 15, 2020 12:51 pm

Hello,

I'm afraid there's no series or tool implemented in TeeChart doing this for you, but once you have the data, it should be possible to use a TSurfaceSeries or a TPoint3DSeries to draw it.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

xsLiu
Newbie
Newbie
Posts: 30
Joined: Wed May 22, 2019 12:00 am

Re: How to draw an elliptic cylinder?

Post by xsLiu » Fri Sep 18, 2020 2:19 am

it should be possible to use a TSurfaceSeries or a TPoint3DSeries to draw it.
It is great and useful.
If it is required to draw a semitransparent surface, how to set Brush’s transparency? Or, is there any other way?

Yeray
Site Admin
Site Admin
Posts: 8971
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: How to draw an elliptic cylinder?

Post by Yeray » Fri Sep 18, 2020 7:58 am

Hello,

Transparency is applied with Blending:

Code: Select all

uses TeCanvas;
//...
var tmpBlend : TTeeBlend;
const transp=80;
begin
  //Prepare Pen and Brush

  if transp>0 then
     tmpBlend:=Chart1.Canvas.BeginBlending(TeeZeroRect,transp);

  //Draw polygon

  if transp>0 then
     Chart1.Canvas.EndBlending(tmpBlend);
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

xsLiu
Newbie
Newbie
Posts: 30
Joined: Wed May 22, 2019 12:00 am

Re: How to draw an elliptic cylinder?

Post by xsLiu » Mon Sep 21, 2020 2:14 am

It works fine.
How to make such a Series visible or not as required? i.e. use a CheckBox to make it visible or not.

Yeray
Site Admin
Site Admin
Posts: 8971
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: How to draw an elliptic cylinder?

Post by Yeray » Fri Sep 25, 2020 1:54 pm

That depends on how are you drawing the polygons. If you are drawing them at a series' OnGetPointerStyle event as in the example I linked above, disabling the series should be enough to stop calling that event and thus your custom drawing code.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply