Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » U++ community news and announcements » Geom cleanup - what do you use?
Geom cleanup - what do you use? [message #60241] Wed, 25 October 2023 12:50 Go to next message
mirek is currently offline  mirek
Messages: 14255
Registered: November 2005
Ultimate Member
Geom package is one of last instances of "old code that needs cleaning / moving to upphub".

There is some very useful code in there, some code that needs polishing and some code that is perhaps too specialised and/or obsolete.

So I have an intention to split Geom, move part to Core (3D geometry stuff mostly, also some geomtric algos like line distance), rest to UppHub.

Before I do, I wanted to ask general community: Which part of Geom do you use?

Mirek
Re: Geom cleanup - what do you use? [message #60243 is a reply to message #60241] Wed, 25 October 2023 13:57 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3432
Registered: August 2008
Senior Veteran
Hi Mirek

In my case I use geometry.h (to see if a point is inside a polygon) and delaunay.h (to get a triangular mesh from a set of points).


Best regards
Iñaki
Re: Geom cleanup - what do you use? [message #60265 is a reply to message #60241] Sat, 28 October 2023 06:56 Go to previous messageGo to next message
deep is currently offline  deep
Messages: 266
Registered: July 2011
Location: Bangalore
Experienced Member
Hi Mirek,

I am using it for various line-line line-arc intersection point calculations.

use geometry.h


Warm Regards

Deepak
Re: Geom cleanup - what do you use? [message #60272 is a reply to message #60241] Mon, 30 October 2023 07:59 Go to previous messageGo to next message
Tom1
Messages: 1301
Registered: March 2007
Ultimate Contributor
Hi Mirek,

I'm using Matrixf and functions related to that.

Best regards,

Tom
Re: Geom cleanup - what do you use? [message #60275 is a reply to message #60241] Mon, 30 October 2023 13:31 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1202
Registered: August 2007
Senior Contributor
Hi Mirek,

Quote:
So I have an intention to split Geom, move part to Core (3D geometry stuff mostly, also some geomtric algos like line distance), rest to UppHub.


Incidentally, I had already moved and refactored/cleaned up most of the 3D code of geom package into Point3D, Xform3D (inspired by and similar to the Painter's Xform2D) structures and to their related functions (as part of a very lightweight software-based 3D renderer called Sculptor package, which I needed at the time).

I can send in a pull request next weekend, if you'd like to review. (to speed up)

Best regards,
Oblivion



[Updated on: Mon, 30 October 2023 13:33]

Report message to a moderator

Re: Geom cleanup - what do you use? [message #60637 is a reply to message #60241] Mon, 17 June 2024 10:23 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1202
Registered: August 2007
Senior Contributor
Hi

As I wrote in my previous message, there is a light-weight XForm3D package I had written some time ago. You can find it attached.

1) It is a single header file.
2) It contains Point3D, Point4D, Matrix3D and Matrix4D classes (API is very similar to XForm2D).
3) These classes are aliases for templates that accept floating point types. So it allows for both single and double precision points (classes are templated)
4) It has an IsEqual() function for fuzzy comparing of matrices.


If you find it useful enough, feel free to review and/or adopt it.

P.s. There is also a simple demo app, rendering the famous 3D teapot model, using Upp::Painter with this XForm3D. I will also upload that (but first I need to clean-up its code).

Best regards,
Oblivion
  • Attachment: Xform3D.h
    (Size: 35.35KB, Downloaded 66 times)


[Updated on: Mon, 17 June 2024 11:23]

Report message to a moderator

Re: Geom cleanup - what do you use? [message #60642 is a reply to message #60241] Tue, 18 June 2024 10:36 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1202
Registered: August 2007
Senior Contributor
XForm3D rendering code:

Attached simple example renders the teapot object, using the XForm3D api + Upp:Painter.

Screenshot:

https://snipboard.io/9AmMJb.jpg

Edit: Fixed layout file path.

Best regards,
Oblivion


[Updated on: Tue, 18 June 2024 10:40]

Report message to a moderator

Re: Geom cleanup - what do you use? [message #60643 is a reply to message #60642] Tue, 18 June 2024 15:58 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3432
Registered: August 2008
Senior Veteran
Hi Oblivion

Although I think the original post was not devoted to show this code, it is very interesting.

To run it in Windows and CLANG as deployed in U++, I have had to do a couple of changes:

- Set 'struct' instead of 'class' in 'template<typename T> struct Point3_;'
- In 'Perspective', 'Frustum' and 'Ortographic', replace 'near' and 'far' with other names. Maybe they are reserved.

The speed is right, even moving >15000 panels. I have opened the teapot four times, moving it to different positions to avoid overlapping.

There are minor details that can be added, such as the definition of background colour, object colour, location and lighting intensity, but, overall, this demo has the highest interest versus size ratio I've seen in a long time Smile

A question: the broken panels selected in red, are they a defect from the original model, or are a defect in rendering?

index.php?t=getfile&id=6946&private=0
  • Attachment: image.png
    (Size: 109.61KB, Downloaded 283 times)


Best regards
Iñaki
Re: Geom cleanup - what do you use? [message #60654 is a reply to message #60643] Sun, 23 June 2024 10:03 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3432
Registered: August 2008
Senior Veteran
It seems that the original mesh doesn't fit well in that area.

index.php?t=getfile&id=6948&private=0
  • Attachment: image.jpg
    (Size: 129.65KB, Downloaded 261 times)


Best regards
Iñaki
Re: Geom cleanup - what do you use? [message #60662 is a reply to message #60642] Thu, 27 June 2024 15:13 Go to previous messageGo to next message
Tom1
Messages: 1301
Registered: March 2007
Ultimate Contributor
Hi Oblivion,

Very nice, indeed!

Just like Iñaki (Koldo) pointed out, I also had to do the following changes on Windows:
Quote:
To run it in Windows and CLANG as deployed in U++, I have had to do a couple of changes:

- Set 'struct' instead of 'class' in 'template<typename T> struct Point3_;'
- In 'Perspective', 'Frustum' and 'Ortographic', replace 'near' and 'far' with other names. Maybe they are reserved.


The same changes are also required on Windows when compiling with MSBT.

Thanks and best regards,

Tom

[Updated on: Thu, 27 June 2024 15:14]

Report message to a moderator

Re: Geom cleanup - what do you use? [message #61653 is a reply to message #60241] Sun, 20 April 2025 13:09 Go to previous message
Oblivion is currently offline  Oblivion
Messages: 1202
Registered: August 2007
Senior Contributor
Hi,

I have uploaded Xform3D as a standalone UppHub package, with example, improvements, autotests and API doc.

Best regards,
Oblivion




Previous Topic: github annoucements tryout
Goto Forum:
  


Current Time: Fri Apr 25 12:14:49 CEST 2025

Total time taken to generate the page: 0.02101 seconds