View Issue Details

IDProjectCategoryView StatusLast Update
0032857CommunityOCCT:Modeling Algorithmspublic2024-01-31 18:47
Reporterchennes Assigned Tonmanchen  
PrioritynormalSeverityminor 
Status assignedResolutionopen 
Target VersionUnscheduled 
Summary0032857: Error when finding the intersection between a new face made after a draft and the inner face of body
DescriptionThis is a bug reported by a FreeCAD community member: the downstream ticket is here:
https://github.com/FreeCAD/FreeCAD/issues/5649

And a post describing an investigation in the issue is here:
https://forum.freecadweb.org/viewtopic.php?p=539132#p539132

Quoting from the discussion there:
[quote]
I compiled a debug version of OCCT 7.5.0 and the bug seems to be in finding the intersection between the new face made after the draft and the inner face of body, which gives the curve for one of the new edges. The new draft face is conical, whose surface is a "double cone" formed by extending the cone beyond it's tip. The inner cylindrical surface intersects this double cone at multiple places (mostly forming two disconnected curves except where the cylinder intersects the tip itself), and the portion that we want is often not found.

I put a break at .../occt/src/Draft/Draft_Modification_1.cxx:921, where the intersection happens. You may need to track down the exact iteration where the problem happens. Multiple "lines" (the intersection curves) are returned after i2s::Perform(...) and even when the draft works correctly (inner diameter >=40 right now), none of these "lines" are what we need. There is some "gluing" that happens after this which fixes the lines, but only in some cases. For now it is with inner diameter >= (distance between cone's axis and origin), but perhaps earlier the sign was inverted.
[/quote]

I've included a DRAW script below that reproduces the issue when the variable "inner rad" is less than the variable "pocket_center".
Steps To Reproduce# Script reproducing the problematic draft case in FreeCAD issue #2497
#Category: Modeling
#Title: OCCT Tutorial pocketed ring

pload MODELING VISUALIZATION

# Set basic dimensions. Problems appear when inner_rad < pocket_center.
dset height 10
dset inner_rad 39
dset outer_rad 50
dset pocket_center 40
dset pocket_rad 20
dset pocket_depth 5

# Construct base profile (the "my_ring")
puts "Constructing my_ring..."

circle c_inner 0 0 0 0 0 1 inner_rad
circle c_outer 0 0 0 0 0 1 outer_rad
mkedge e_inner c_inner
mkedge e_outer c_outer
wire w_inner e_inner
wire w_outer e_outer

plane p0
mkface my_ring_inner_base p0 w_inner
mkface my_ring_outer_base p0 w_outer

prism my_ring_inner my_ring_inner_base 0 0 height
prism my_ring_outer my_ring_outer_base 0 0 height

bcut my_ring my_ring_outer my_ring_inner

# Make the pocket
puts "Constructing pocket..."

circle pocket_base pocket_center 0 0 0 0 1 pocket_rad
mkedge pocket_base pocket_base
wire pocket_base pocket_base

mkface pocket_base p0 pocket_base

prism my_pocket pocket_base 0 0 pocket_depth

# Make the cut
puts "Making the cut"

bcut slotted_ring my_ring my_pocket

explode slotted_ring F

# Make the draft
puts "Drafting the face"

# Found face by trial and error: slotted_ring_3
# Perform the draft
depouille slotted_ring_with_draft slotted_ring 0 0 -1 slotted_ring_3 44 0 1 0 0 0 1

puts "Showing result..."

# Display result
vdisplay slotted_ring_with_draft
vfit
TagsNo tags attached.
Test case number

Activities

git

2022-10-19 17:26

administrator   ~0111673

Branch CR32857 has been created by nmanchen.

SHA-1: c70f4adbc6ddd4006bb0bca908d262767935630b


Detailed log of new commits:

Author: nmanchen
Date: Wed Oct 19 17:26:28 2022 +0300

    0032857: Error when finding the intersection between a new face made after a draft and the inner face of body
    
    Seam vertex projection on aCurve is used as comparison point instead of aCurve end

Author: nmanchen
Date: Wed Oct 19 15:57:45 2022 +0300

    0032857: Error when finding the intersection between a new face made after a draft and the inner face of body
    
    Intersection curve on cone or cylinder is now added as a candidate even if it is not on seam.

git

2022-10-20 12:18

administrator   ~0111684

Branch CR32857 has been updated forcibly by nmanchen.

SHA-1: cefa64bf799b30d0b4c4971977826df31892ae24

git

2022-11-04 01:08

administrator   ~0111902

Branch CR32857 has been updated forcibly by nmanchen.

SHA-1: b590c68075da1c62f7466166c2341e5a52c7b0f9

git

2022-11-10 13:07

administrator   ~0111988

Branch CR32857_use_trim_surface has been created by nmanchen.

SHA-1: bc180fe616407301a6328749b5249d5d010f45ab


Detailed log of new commits:

Author: nmanchen
Date: Thu Nov 10 12:58:05 2022 +0300

    0032857: Error when finding the intersection between a new face made after a draft and the inner face of body
    
    myGeom is now initialized by input surface for Draft_FaceInfo even if its type is Geom_RectangularTrimmedSurface.

git

2022-11-14 08:45

administrator   ~0112077

Branch CR32857_use_trim_surface has been updated forcibly by nmanchen.

SHA-1: 7b98ef4e57d0a2f2e981df51db6f8d2cfb8726dd

git

2022-11-17 06:49

administrator   ~0112138

Branch CR32857_use_trim_surface has been updated by nmanchen.

SHA-1: 7a1d6342a35b6f5e454991b11ee1dc90d7f03718


Detailed log of new commits:

Author: nmanchen
Date: Thu Nov 17 06:49:23 2022 +0300

    Merge branch 'master' of ssh://git.dev.opencascade.org/occt into CR32857_use_trim_surface

git

2022-11-24 07:16

administrator   ~0112287

Branch CR32857_use_trim_surface has been updated forcibly by nmanchen.

SHA-1: acaaf4f598548cdc6779f41eb4d7e7ca46fedaf8

git

2022-12-02 05:39

administrator   ~0112461

Branch CR32857_use_trim_surface has been updated by nmanchen.

SHA-1: f53c218335805e7fc427740df6b41bf42e0d86a4


Detailed log of new commits:

Author: nmanchen
Date: Fri Dec 2 05:38:49 2022 +0300

    Merge branch 'master' into CR32857_use_trim_surface

git

2022-12-02 15:02

administrator   ~0112475

Branch CR32857_2 has been created by nmanchen.

SHA-1: 022b6bdff7785574c2eaefcf390e5c81332260cc


Detailed log of new commits:

Author: nmanchen
Date: Thu Nov 10 12:58:05 2022 +0300

    0032857: Error when finding the intersection between a new face made after a draft and the inner face of body
    
    myGeom is now initialized by input surface for Draft_FaceInfo even if its type is Geom_RectangularTrimmedSurface.
    input cylindric faces is not necessary to be trimmed (fixes bug712_1)

emv

2022-12-07 10:34

developer   ~0112509

Please correct the code as agreed and check the test results more carefully.

ebelouso

2023-03-06 20:02

administrator   ~0113234

@nmanchen Please check into this.

Issue History

Date Modified Username Field Change
2022-02-25 21:33 chennes New Issue
2022-02-25 21:33 chennes Assigned To => msv
2022-09-26 14:57 nmanchen Assigned To msv => nmanchen
2022-10-19 17:26 git Note Added: 0111673
2022-10-20 12:18 git Note Added: 0111684
2022-10-24 10:40 szy Target Version 7.7.0 => 7.8.0
2022-11-03 14:59 szy Status new => assigned
2022-11-04 01:08 git Note Added: 0111902
2022-11-10 13:07 git Note Added: 0111988
2022-11-14 08:45 git Note Added: 0112077
2022-11-17 06:49 git Note Added: 0112138
2022-11-24 07:16 git Note Added: 0112287
2022-12-02 05:39 git Note Added: 0112461
2022-12-02 15:02 git Note Added: 0112475
2022-12-05 08:58 nmanchen Assigned To nmanchen => emv
2022-12-05 08:58 nmanchen Status assigned => feedback
2022-12-05 09:01 nmanchen Status feedback => resolved
2022-12-07 10:34 emv Assigned To emv => nmanchen
2022-12-07 10:34 emv Status resolved => assigned
2022-12-07 10:34 emv Note Added: 0112509
2023-03-06 20:02 ebelouso Note Added: 0113234
2023-08-01 15:06 dpasukhi Target Version 7.8.0 => Unscheduled