Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6532875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:03:27+00:00 2026-05-25T10:03:27+00:00

I have two Point structures and I need to draw an I-Beam based on

  • 0

I have two Point structures and I need to draw an I-Beam based on those points, where each point represents the cross-section on either side of the I-Beam. The width of the end caps should be fixed and arbitrary.

Basically I need to draw three lines. First I’ll DrawLine(Point1, Point2), then I need the math to figure out how to draw the next two lines on perpendicular angles so that they are centered on Point1 and Point2.

The image below shows what I need to draw based on the center line. However, this line can be at any angle. The Point1 and Point2 that connect the line can be anywhere in a 2D space.

Example of an I-Beam

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:03:27+00:00Added an answer on May 25, 2026 at 10:03 am

    You can try playing around with LineCaps:

    protected void DrawIBeam(Graphics g, Point fromPoint, Point toPoint)
    {
      using (GraphicsPath hPath = new GraphicsPath())
      {
        hPath.AddLine(new Point(-5, 0), new Point(5, 0));
        CustomLineCap myCap = new CustomLineCap(null, hPath);
        myCap.SetStrokeCaps(LineCap.Round, LineCap.Round);
        using (Pen myPen = new Pen(Color.Black, 2))
        {
          myPen.CustomStartCap = myCap;
          myPen.CustomEndCap = myCap;
          g.DrawLine(myPen, fromPoint, toPoint);
        }
      }
    }
    

    and call it:

    DrawIBeam(e.Graphics, new Point(10, 10), new Point(60, 60));
    

    enter image description here

    From CustomLineCap Class

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one line (two point (x,y) (x1,y1)) and a rectangle with focus point
I have two quick questions: When do two file descriptors point to the same
I have two webservices that have exactly the same methods and signatures but point
I have two models, Category and Point . The associations are defined as: Category
I have two points (a line segment) and a rectangle. I would like to
I have two points in 3D space: a = (ax, ay, az) b =
i have two points in 3D space which have X-coordinates with different signum. so
In a two dimentional integer space, you have two points, A and B. This
I have an image with two points, aligned something like this: |----------------| | |
I have two questions: 1) How can I make an array which points to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.